gpt4 book ai didi

shell - "[: too many arguments"偶尔会出现 pidof

转载 作者:行者123 更新时间:2023-12-04 17:36:32 24 4
gpt4 key购买 nike

 cplane_pid=`pidof hnb_gw.exe`
if [ -z $cplane_pid ]
then
STATUS=`failure`
echo "Cplane hnbgw running $STATUS"
else
STATUS=`success`
echo "Cplane hnbgw running $STATUS"
fi
echo

最佳答案

如果hnb_gw.exe有多个实例, pidof 将返回多个 pid。 -z[期望只有一个 pid。一种解决方案可能是使用 -s pidof 的开关以仅返回一个 pid。

关于shell - "[: too many arguments"偶尔会出现 pidof,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17165138/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com