开发者

What will be the return status in the following shell script

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜