summaryrefslogtreecommitdiff
path: root/tests/errors6.sub
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2018-05-22 16:51:07 -0400
committerChet Ramey <chet.ramey@case.edu>2018-05-22 16:51:07 -0400
commit9a51695bed07d37086c352372ac69d0a30039a6b (patch)
tree4d0f57cba0dd1ec7a75aae56e18cfe9997d0b7a7 /tests/errors6.sub
parent7de27456f6494f5f9c11ea1c19024d0024f31112 (diff)
downloadbash-5.0-alpha.tar.gz
bash-5.0-alpha releasebash-5.0-alpha
Diffstat (limited to 'tests/errors6.sub')
-rw-r--r--tests/errors6.sub23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/errors6.sub b/tests/errors6.sub
index 3c05625a..b80580e7 100644
--- a/tests/errors6.sub
+++ b/tests/errors6.sub
@@ -15,6 +15,29 @@ echo array after 1: $?' 2>/dev/null
${THIS_SH} -c 'typeset -A v ; v["0"]=one ; echo ${v[ ]}
echo array after 2: $?' 2>/dev/null
+${THIS_SH} -c 'echo ${uvar?}' ./errors6.sub
+${THIS_SH} -c 'echo ${uvar:?}' ./errors6.sub
+export uvar=
+${THIS_SH} -c 'echo ${uvar?}' ./errors6.sub
+${THIS_SH} -c 'echo ${uvar:?}' ./errors6.sub
+unset uvar
+
+echo "${-3:-${-3}}"
echo ${-3}
x=-3; echo ${!x}
echo after indir: $?
+
+function ivar() { echo -n "${!1:-${1}}"; }
+ivar -3
+
+foo=bar
+echo ${!foo}
+echo ${!foo:-unset}
+
+echo ${!var:-unset}
+echo ${!var+unset}
+
+foo=invalid-ident
+echo ${!foo}
+echo ${!foo:-unset}
+echo ${!foo+unset}