Printing out the Return Code / Exit Code from a shell prompt

During the automation process, it is helpful to know how a program exited. When that program is called from a command (cmd) or shell (bash) prompt, you can print out the return code using the following commands directly after the command was run and exited:

Windows

echo %ERRORLEVEL%

Linux

echo $?

0saves
If you enjoyed this post, please consider leaving a comment or following John Andersen on Twitter.

Leave a Reply