grep and exit

I have a scenario, where i need to grep for the information and then exit.

i have to grep for "import done" and "bye" from success.log and then update a file with success if these words are present and failure if they are not present.

can any one help with this scenario?

 
grep "import done" success.log > /dev/null && grep "bye" success.log > /dev/null && echo "Success" > /tmp/log || echo "Failure" > /tmp/log

but in the above scenario it is updating as failure , even though we can find "import done" and "Bye" in success.log

grep "Bye" success.log 
1 Like

thnx itkamaraj, it works.