Bash Reference Manual
mardi 28 juillet 2015 à 11:13@jeekajoo shaarlinks
"""
${parameter:-word}
If parameter is unset or null, the expansion of word is substituted. Otherwise, the value of parameter is substituted.
"""
Exemple d'utilisation:
"""
exitcode=${2:-1}
"""
Si $2 est défini, exitcode = $2. Sinon exitcode = $1
(Permalink)
"""
${parameter:-word}
If parameter is unset or null, the expansion of word is substituted. Otherwise, the value of parameter is substituted.
"""
Exemple d'utilisation:
"""
exitcode=${2:-1}
"""
Si $2 est défini, exitcode = $2. Sinon exitcode = $1
(Permalink)