Isso não é bash
específico, mas existe na Bourne Shell desde 1976.
Verifique a página do manual do Bourne Shell:
Verifique a seção Substituição de parâmetros começando na página 7.
${parameter-word} Use Default Values. If parameter is unset,
the expansion of word is substituted;
otherwise, the value of parameter is substituted.
Para uma visão geral completa, há:
| parameter nonnull | parameter null | parameter unset ___________________|___________________|_________________|________________ ${parameter:-word} | subst. parameter | subst. word | subst. word ___________________|___________________|_________________|________________ ${parameter-word} | subst. parameter | subst. null | subst. word ___________________|___________________|_________________|________________ ${parameter:=word} | subst. parameter | assign word | assign word ___________________|___________________|_________________|________________ ${parameter=word} | subst. parameter | subst. null | assign word ___________________|___________________|_________________|________________ ${parameter:?word} | subst. parameter | error, exit | error, exit ___________________|___________________|_________________|________________ ${parameter?word} | subst. parameter | subst. null | error, exit ___________________|___________________|_________________|________________ ${parameter:+word} | subst. word | subst. null | subst. null ___________________|___________________|_________________|________________ ${parameter+word} | subst. word | subst. word | subst. null ___________________|___________________|_________________|________________