aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-vars/var_bash1a.tests
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush_test/hush-vars/var_bash1a.tests')
-rwxr-xr-xshell/hush_test/hush-vars/var_bash1a.tests11
1 files changed, 11 insertions, 0 deletions
diff --git a/shell/hush_test/hush-vars/var_bash1a.tests b/shell/hush_test/hush-vars/var_bash1a.tests
new file mode 100755
index 000000000..551dd9acc
--- /dev/null
+++ b/shell/hush_test/hush-vars/var_bash1a.tests
@@ -0,0 +1,11 @@
+parameter=abcdef
+offset=2
+noffset=-2
+echo "parameter '${parameter}'"
+echo "varoffset2 '${parameter:${offset}}'"
+echo "varoffset-2 '${parameter:${noffset}}'"
+echo "literal '2' '${parameter:2}'"
+# This is not inrpreted as ${VAR:POS{:LEN}},
+# but as ${VAR:=WORD} - if VAR is unset or null, substitute WORD
+echo "literal '-2' '${parameter:-2}'"
+echo "literal ' -2' '${parameter: -2}'"