What will be the return status in the following sheel script.
- by Pradip Bhojania
i have two shell scripts:
script1.sh
echo "date : DATE"
exit 0;
script2.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?