|
1. Check if the command exists *and* is executable
2. Quote ${command} in case it contains whitespace, which would break
syntax in the test (though, because it uses Bash builtin "[[" instead
of the normal "/usr/bin/[", Bash *usually* recovers from this safely.
3. Go ahead and exit with an error if we print a fatal error message,
don't keep running.
4. Put "$@" in quotes; it preserves whitespace in the arguments (while
still keeping separate arguments separate).
|