看例子就好:
unset X Y Z
#${variable?value} - Complain if undefined
cat ${jack?”Please define jack, and try again”}
#${variable-default} - Use default if undefined
echo X is: $X
echo X is: ${X-default}
X=new
echo X is: ${X-default}
echo X is: $X
#${variable+value} - Change if defined
echo Y is: $Y
echo Y is: ${Y+”Current value of Y is $Y”}
Y=”test”
echo Y is: $Y
echo Y is: ${Y+”Current value of Y is $Y”}
echo Y is: $Y
#${variable=value} - define if undefined
echo Z is: $Z
echo Z is: ${Z=default}
Z=”test”
echo Z is: ${Z=default}
echo Z is: $Z