I'm writing a script that will automate the startup of a few services but some actions are dependent upon the successful completion of others. I can check for this by scanning the log file until the message I'm looking for appears but I can't seem to work this part into my script. I've tried:
Code:
while [ `tail -f /path/to/log/file | grep "PATTERN"` -ne "0" ]; do
done
just to idle until the correct message appears but it is just hanging forever even though I know the message has been written to the log.
What's the best way to fix this?