{ads}

Checking exit codes in bash



September 05, 2022 at 03:30PM

There are quite a few exit codes used on Linux systems, though no listing you can display when you’re feeling curious. In fact, you won’t see the numeric codes unless you specifically ask for them.

Instead, you will see a textual description of the problem you encountered—such as “No such file or directory”—in a context like this:

$ bin/runme
bash: bin/runme: No such file or directory

If you want to see the numeric exit code, you can use the echo $? command. The error message will tell you that there is no “runme” script in your bin directory. The echo $? command will respond with only a number.

To read this article in full, please click here



from Network World https://ift.tt/9GTzcXw

0 Response to "Checking exit codes in bash"

Post a Comment

Article Top Ads

Central Ads Article 1

Middle Ads Article 2

Article Bottom Ads