Bash: Using a default value with $*

In Bash, $* gives you the IFS expansion of all positional parameters, such as $1 $2 $3 etc. This can be super handy when dealing with inline helper functions, but the use cases are too many to count.

Assigning a fallback default value uses the same syntax as regular variables do, but the syntax would make you look twice the first time you saw it:

# Use $1 $2 $3 etc, or "foo" if no parameters are specified
${*:-foo}