Quote:
Originally Posted by ericshliao
. /home/root/mybootscript.sh
mv /home/root/mybootscript.sh /home/root/_mybootscript.sh
|
Beware of that: it's safer to move the script before sourcing (.) its contents -- a syntax error in your script, a while loop that never ends or a wrongly composited kill in mybootscript.sh that makes it commit suicide

would be some scenarios that would be fatal with your current code.
AFAICT Hansel's code is safe.