avatar
c*e
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.
avatar
d*c
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.

avatar
B*z
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.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。