diff options
Diffstat (limited to 'tests/posixexp6.sub')
-rw-r--r-- | tests/posixexp6.sub | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/posixexp6.sub b/tests/posixexp6.sub new file mode 100644 index 0000000..ed38d53 --- /dev/null +++ b/tests/posixexp6.sub @@ -0,0 +1,57 @@ +var=$'\01\02\03\177' + +bar=${unset:-$var} +recho "$bar" +unset -v bar +bar=${unset:-"$var"} +recho "$bar" + +foo=${parameter:=$var} + +recho "$foo" +recho "$parameter" + +unset -v foo parameter + +foo=${parameter:="$var"} + +recho "$foo" +recho "$parameter" + +unset -v foo parameter + +foo="${parameter:=$var}" + +recho "$foo" +recho "$parameter" + +unset -v foo parameter + +recho ${parameter:=a\ b} +unset -v parameter + +recho ${parameter:="a b"} +unset -v parameter + +v='a b' + +recho ${parameter:=$v} +unset -v parameter + +recho ${parameter:="$v"} +unset -v parameter + +# unsetting IFS here + +set " abc " " def ghi " "jkl " +unset -v IFS var +var=${var-$*}/${var-$*} +printf '[%s]\n' "$var" + +unset -v var +: ${var=$*} +printf '[%s]\n' "$var" + +unset -v var +: ${var:=$*/$*/${var-$*}} +printf '[%s]\n' "$var" |