Wednesday 18 December 2013

Exit status of previous command - Unix

In Unix, one is often asked to find out the exit status of previous command i.e whether it was executed successfully or not.

In order to find out, type the foll. in terminal :

echo $?

If the output is 0 then it means the previous command got executed successfully.

If the previous command failed then the output of echo $? would be 127.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
eXTReMe Tracker