Check if your shell command was successfully executed
Every executed command in UNIX systems have an exit status code on it. That means that we can actually identify if a command was successfully completed of generate some kind of error.
After execute a command on your terminal window type the following:
$ echo $?
If your previous code was successfully executed this command should show "0" which indicates that your command was successfully executed.
Happy hacking!
Written by Mariz Melo
Related protips
1 Response
With ZSH (and maybe with Bash) you can have $? printed right in your PS prompt. That way you can't accidentally lose the data if you forget to echo.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#