i have two shell scripts:
script1.sh
echo "`date` : DATE"
exit 0;
scri开发者_Python百科pt2.sh
./scripts1.sh
if [ $? -eq 0 ]; then
reboot;
else
echo "Failed"
fi
What should be the result. Ideally it should have been "reboot" , however on some execution i got the "failed" message too. Can anyone explain why this happens?
It looks to me like the second script calls a script named, "scripts1.sh," but the name of the first script is, "script1.sh." In other words, you have an extra "s" in the name of that first script, when you reference it in the second.
精彩评论