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

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -