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