19 Mar
2001
19 Mar
'01
17:51
Today, Mar 19, Christopher D. Reimer wrote:
test $(ps x | grep "/bin/bash /root/scripts/setiathome") || exit 1
When I run the following grep command, I get two matches:
server:~ # ps x | grep "/bin/bash /root/scripts/setiathome" 9436 pts/0 S 0:00 /bin/bash /root/scripts/setiathome 9445 pts/0 S 0:00 grep /bin/bash /root/scripts/setiathome
The first match (process 9436) is what I'm testing for. If the first match is not running, grep exits with a zero since the second match is found. How do I eliminate the second match?
ps x | grep ["/bin/bash "]/root/scripts/setiathome Ken