linux 如何开机自动运行sh脚本

  1. linux 如何开机自动运行某sh脚本。比如开机自动运行 /test.sh
    第二个问题,还有什么办法可以确定test.sh已经正确运行了
  2. 要开机 运行只需将它加入到 rc.local ,一般为/etc/rc.d/rc.local 在其中加入以下行:
  3. sh /path/to/test.sh
  4. 使用linux全局变量$?可以确定是否执行,如
    if [$? eq 0]
        then

  5.                 echo "succeed!"

        fi

#modified some typo --update @22:48

猜你喜欢

转载自weitao1026.iteye.com/blog/2398828