我是shell脚本的初学者,需要一个脚本来检查一个进程的状态,并在输出时"输出","关闭时"输出"不运行".
我尝试了下面的一个,但它不起作用:
if [ -s `/opt/reds/recycle.sh status | grep "pid"` ]; then echo "running" else echo "not running" fi
有人可以帮帮我吗?
shell grep if-statement
grep ×1
if-statement ×1
shell ×1