Monday, February 8, 2016

How to check the exit code of a command (on Linux and Windows)

To check the exit code of an application on Linux and Windows is very easy.

In a Linux' bash, you need to issue the command: 

echo "$?"


echo "$?" will return the exit code of the previous command (please note that also an empty line counts as a command!)


In a Windows' command prompt:

echo %errorlevel%

No comments:

Post a Comment

Your comment will be visible after approval.