I'm trying to start/stop the app server using os.system command in my python script. I have to wait until the server start/stop. I'm trying to loop through log file using grep command below. But I'm getting invalid syntax on the search string on the double quote(single quote). If i run the grep command directly it works fine. Please let me know what would be the issue or any alternative way. (I'm using Redhat enterprise linux )
while ! grep -m1 'Server started' < /apps/logs/messages.log; do sleep 1 done
In my python job when i tried to run the below code, I'm getting "invalid syntax" on the search string double quote (tried single quote as well). Both failing with invalid syntax error. Can you please let let me know what would be the issue. (Redhat enterprise linux).