2008年7月9日 星期三

shell parameter expansion


parameter set and not null parameter set and nullparameter unset
${parameter:-word}substitute parametersubstitute wordsubstitute word
${parameter-word}substitute parametersubstitute nullsubstitute word
${parameter:=word}substitute parameterassign wordassign word
${parameter=word}substitute parametersubstitute parameterassign null
${parameter:?word}substitute parametererror, exiterror, exit
${parameter?word}substitute parametersubstitute nullerror, exit
${parameter:+word}substitute wordsubstitute nullsubstitute null
${parameter+word}substitute wordsubstitute wordsubstitute null

沒有留言: