I am trying to check if a process (assume it is called some_process) is running on a server. If it is, then echo 1, otherwise echo 0.
some_process
This is the command th
Use grep -vc to ignore grep in the ps output and count the lines simultaneously.
grep -vc
grep
ps
if [[ $(ps aux | grep process | grep -vc grep) > 0 ]] ; then echo 1; else echo 0 ; fi