Errors a User Can Act On

A script people depend on says what went wrong and what to do about it: it prints problems on standard error with >&2, stops with an exit code that means something (0 it worked, 1 it failed, 2 it was run wrong), and keeps those habits in a die function and a usage message.

Updated

Cheat sheet for the lesson Errors a User Can Act On: A script people depend on says what went wrong and what to do about it: it prints problems on standard error with >&2, stops with an exit code that means something (0 it worked, 1 it failed, 2 it was run wrong), and keeps those habits in a die…
Category
Bash
Level
Journeyman
Tags
exit-code, linux, shell-function, standard-streams, unix, usage-message