A shell colon does nothing. Use it anyway
# Summary
The shell colon (`:`) is a null-command builtin that, while doing nothing on its own, can be cleverly combined with parameter expansion to create powerful one-line shortcuts. For example, `: "${1:?missing argument}"` replaces multiple lines of argument-checking code by automatically printing an error message and exiting if a required variable is unset or empty. This simple but ancient Unix feature, dating back to 1971, demonstrates how understanding basic shell mechanics can significantly simplify script writing.
Read Full Article →