From man page: `${parameter:-word}` : Use Default Values. If parameter is unset or null, the expansion of word is substituted. Otherwise, the value of parameter is substituted.
– WiimmApr 13 '23 at 13:07
1
It does nothing *to* `arg1`; it does something *with* the (lack of a) value of `arg1`.
– chepnerApr 13 '23 at 13:18
1
@Wiimm : Not entirely true. The difference is cruicial, when you program your script with `set -u` turned on (which, IMHO, is a good idea), and `arg1` is undefined. By distinguishing these cases, you can catch undefined variables.
– user1934428Apr 13 '23 at 13:18
1
In case of `${arg1:-}`: if unset or empty then return an empty string.
– WiimmApr 13 '23 at 13:24