Re:A shell colon does nothing. Use it anyway.
by wolletd on Sunday July 26, 2026 @06:44AM
(#49056703)
For a short-lived script, the `${1:?missing argument}` stuff may be useful, but usually, I want to print some longer usage or help text in the error case.
I usually go with something like this:
The `${1:-}` in this case evaluates to an empty string if `$1` is not set, but `shift` fails when there is no argument to remove.