sh bothworkfile.txt >> cleanup_process.log
while [[ `ps -eaf | grep -c "cleanx"` -ge 2 ]]
do
sleep 10
echo "Please be patient, we are still cleaning stuffs ! "
done
echo " Clean up is done."
嗨我正在使用ksh。 bothworkfile.txt包含几行用于在后台运行进程。虽然在ksh循环
cat bothworkfile.txt
cleanx data01.xsd*.* &
cleanx data01.xsd*.* &
Cleanx是我的本地shell中的一个实用程序。默认情况下,总是有一个cleanx在后台运行。因此,
ps -eaf | grep -c "cleanx"
总是给出1,但是当脚本调用它时,数字会增加。
但现在的问题是,似乎我无法进入while循环。运行脚本后,它会打印出“清理完成”。
请帮我理解它为什么不进入while循环。再次,它的ksh shell。
当我做cleanx data01.xsd * * cleanx data01.xsd * *命令行和运行PS -eaf上| grep -c“cleanx”它显示3 ...所以'ps -eaf | grep -c“cleanx”'-ge 2是正确的..但它的整个while循环.. – May