Hi not sure if this is the correct forum...
exit builtin accepts one and only one arg currently.
Would it be backwards compatible and generally useful to support echoing a
reason for exiting?
test -f file || exit 2 "file not found"
good bash scripters handle and report errors
have seen lots of functions in the wild like
function die() {
echo $@
exit 1
}
function die() {
code=$1
shift
echo $@
exit $code
}
but none has made its way to a reliably available default, so its oft repeated,
and more often omitted so failure prints nothing.
Could it be a candidate for an extension to bash's exit builtin? I don't think
anything existing would break, currently we get too many args and it does not
exit