當前位置:編程學習大全網 - 電腦編程 - Linux。 Shell編程。 為hello.sh寫壹個守護進程watchDog.sh

Linux。 Shell編程。 為hello.sh寫壹個守護進程watchDog.sh

watchDog.sh實例,這個只是個思路,具體妳得自己測試

#!/bin/sh

hello=`ps -ef| grep hello.sh|grep -v grep |awk '{print $2}'`

while true;

do

if [ ! $hello ]; then

./hello.sh

fi

done

  • 上一篇:下載三菱PLC編程軟件出現問題
  • 下一篇:有人閱讀 編程隨想 的博客嗎
  • copyright 2024編程學習大全網