Do manual bash ( o padrão POSIX tem um texto semelhante ):
${parameter:-word}: Use Default Values. Ifparameteris unset or null, the expansion ofwordis substituted. Otherwise, the value ofparameteris substituted.
${parameter:?word}: Display Error if Null or Unset. Ifparameteris null or unset, the expansion ofword(or a message to that effect ifwordis not present) is written to the standard error and the shell, if it is not interactive, exits. Otherwise, the value ofparameteris substituted.
Se a variável MESG for uma cadeia de caracteres não nula, eles farão o mesmo (expandir para o valor da variável MESG ). Se estiver vazio ou não estiver definido, ${MESG:-HI} será substituído pela string HI e ${MESG:?HI} exibirá HI no erro padrão e sairá da sessão atual do shell (a menos que seja uma sessão interativa). / p>