Bash shell scripting variables -
i have following line in shell script:
if [ -n "${use_x:+1}" ]; then
i cannot figure out ":+1" part means. ideas?
have here. url provides following explanation:
${parameter:+alt_value}
if parameter set, use alt_value, else use null string.
and has following example:
echo echo "###### \${parameter:+alt_value} ########" echo a=${param4:+xyz} echo "a = $a" # = param5= a=${param5:+xyz} echo "a = $a" # = # different result a=${param5+xyz} param6=123 a=${param6:+xyz} echo "a = $a" # = xyz
Comments
Post a Comment