要开机运行只需将它加入到 rc.local ,一般为/etc/rc.d/rc.local 在其中加入以下行:
sh /path/to/test.sh
或者 sudo /path/to/test.sh
或者 cd /path/to/
./test.sh
查看是否执行可加入
- if [ $? -eq 0 ];then
- echo A
- else
- echo B
- fi
要开机运行只需将它加入到 rc.local ,一般为/etc/rc.d/rc.local 在其中加入以下行:
sh /path/to/test.sh
或者 sudo /path/to/test.sh
或者 cd /path/to/
./test.sh
查看是否执行可加入