- How to automatically run a sh script on boot in linux.
For example , the second question is to automatically run /test.sh at boot . Is there any way to make sure that test.sh has run correctly? - To start running, just add it to rc.local, usually /etc/rc.d/rc.local and add the following line to it:
- sh /path/to/test.sh
-
Use the linux global variable $? to determine whether to execute, such as
if [$? eq 0]
then - echo "succeed!"
be
#modified some typo --update @22:48