mercredi 19 avril 2017

How to improve if condtion for better results?

I have to add a if condition in my script. In this condition I have to run a command which check the status. if output contain "process is running" then it should be true other wise false.

condition added by me:

if [ /net/apps/bin/startup status | grep "process is running" | wc -l -gt 0 ]; then

but some times it not working as some error message displayed on screen.

Example:
bash$ /net/apps/bin/startup status| grep "process is running" | wc -l
 Cannot find /lib64/ld-linux-x86-64.so.2
   0

Aucun commentaire:

Enregistrer un commentaire