Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all,
I'm trying to get a if/then/else check with a integer comparison on wc -l, but not having much luck.
I want to check if there are a certain number of processes running, and if so, print sucess message/run something else.
So far all I get are errors when I do
#!/bin/sh
ps -ef | grep tomcat | if [wc -l -ne 2]; then echo "Not running"
else echo "Running"
fiAny suggestions/ideas on where I'm going wrong?
Thanks in advance,
elpico.

![]() |
IO Error on X server
|
2>&1 &
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |