According to the bash manual ,! implies that the value of val1 should be used as a parameter for the extension. So why is val2 not set to βtextβ after line 6?
echo ${val1:-"val1 not set"}
echo ${val1:="val2"}
echo ${val1+"val1 set"}
echo ${!val1:-"val 2 not set"}
echo ${!val1:="text"}
echo ${!val1:-"val2 not set"}
echo ${val2:-"val2 not set"}
val2="val2 set"
echo ${!val1:-"val2 not set"}
echo ${val2:-"val2 not set"}
source
share