I get a log file as soon as I run one command(process is still running in background). Now I want to fetch the status (clean or un-clean) from that log file. If status is clean then I will leave the process as is else, if it is un-clean then I have to kill the process which was started by my first command and re-run the same command again.
I have tried with
cat logfilename | grep "un-clean". But I don't know how to verify this output in shell script.
I want something like (roughly)
var= clean then the output of above command == var if yes then echo "ok" else re-run command
I have tried some of the commands but not working for me.