I have this:
while [ "ps aux | grep '[0]:00 Xvfb :99 -screen 0 1024x768x16'" ]
do
echo "sleep"
ps aux | grep "[0]:00 Xvfb :99 -screen 0 1024x768x16"
sleep 1
done
This gives me:
sleep
sleep
sleep
sleep
sleep
sleep
root 7 0.5 1.5 207336 31620 ? Sl 09:31 0:00 Xvfb :99 -screen 0 1024x768x16
sleep
root 7 0.4 1.5 207336 31620 ? Sl 09:31 0:00 Xvfb :99 -screen 0 1024x768x16
sleep
root 7 0.3 1.5 207336 31620 ? Sl 09:31 0:00 Xvfb :99 -screen 0 1024x768x16
...
...
...
How can I change my oneliner so that the loop is exited once the ps aux | grep
returns 0 (meaning the Xvfb process is running)?