silently: easily error proof terminal scripts

One of the most useful programs I came with for scripting, now available in the AUR.

DESCRIPTION:
Silences a command output except on error, so its correct operation is self supervised (aka jidoka).

USAGE:
set -e
silently [-try] [-function] [command]

LEGEND:
[-try]
If present silently always succeeds, so the parent process won't abort.

[-function]
Optionally the name of the function that invoked silently, so in case of error it will be printed along with the error message for an easier debugging.

[command]
The line to be executed, surrounded with quotes.

DANGERS:
In [command] surround variables with escaped double quotes, or your program will be vulnerable to code injection.

If [command] never finishes or it's interactive, silently will hang. If that can happen use the command timeout.

1 Like

Forum kindly sponsored by