pmurach

Joined 13 years ago

Karma
236
Submissions
47
Member since
Jun 22
Software engineer by day, open source enthusiast by night, mathematician by design and human languages enthusiast by life.

GitHub: https://github.com/piotrmurach

View on Hacker News

Recent submissions

Comment · 6 years ago
Exit codes are only used in the context of terminal shells. So it seems appropriate to refer to terminals. Wouldn't you agree?
Comment · 6 years ago
Comment · 6 years ago
In this context "Do not use them.", these are reserved codes and shouldn't be redefined in your programs to mean something entirely different. So codes in range 64-78 are a standard across Unix systems. Usually, specific program codes are best served using codes below 64.

I have included a method that helps you check if a code is reserved or not. For example, TTY::Exit.exit_reserved?(126) will return true as this is a status used by Bash to indicate a problem with executing a command.

Comment · 6 years ago
This library improves the situation as:

* It includes default user-friendly error messages for all the built-in exit codes. For example, the code 64 will print " "ERROR(64): Command line usage error" to stderr.

* Machines, e.i. programs that, for example, watch over an executable can decided based on the error code what to do. If the program is interrupted by Ctrl-C then the parent program can handle the situation gracefully.

I totally agree that an example of using an exit code in a parent program would be beneficial.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton