c********e 发帖数: 417 | 1 The shell script does the following:
if a certain process is not running, then start it.
I'm think of using 'ps-e|grep process', but I don't know how to test
if a string is empty.
Thanks. | d***c 发帖数: 21 | 2 there should be an easy way, but if you do 'ps -e|grep -c process', then you only need to check if the result is 0.
【在 c********e 的大作中提到】 : The shell script does the following: : if a certain process is not running, then start it. : I'm think of using 'ps-e|grep process', but I don't know how to test : if a string is empty. : Thanks.
| B**z 发帖数: 153 | 3 if ps -e |grep -c process > /dev/null;then
# do something
fi
【在 d***c 的大作中提到】 : there should be an easy way, but if you do 'ps -e|grep -c process', then you only need to check if the result is 0.
|
|