summaryrefslogtreecommitdiff
path: root/shell/ash_test/ash-vars/var_posix1.tests
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash_test/ash-vars/var_posix1.tests')
-rwxr-xr-xshell/ash_test/ash-vars/var_posix1.tests37
1 files changed, 34 insertions, 3 deletions
diff --git a/shell/ash_test/ash-vars/var_posix1.tests b/shell/ash_test/ash-vars/var_posix1.tests
index 4139e2c..82abe81 100755
--- a/shell/ash_test/ash-vars/var_posix1.tests
+++ b/shell/ash_test/ash-vars/var_posix1.tests
@@ -1,3 +1,25 @@
+unset var
+
+echo Empty:${var#}
+echo Empty:${var##}
+echo Empty:${var#*}
+echo Empty:${var##*}
+echo Empty:${var%}
+echo Empty:${var%%}
+echo Empty:${var%*}
+echo Empty:${var%%*}
+
+var=
+
+echo Empty:${var#}
+echo Empty:${var##}
+echo Empty:${var#*}
+echo Empty:${var##*}
+echo Empty:${var%}
+echo Empty:${var%%}
+echo Empty:${var%*}
+echo Empty:${var%%*}
+
var=ababcdcd
echo ${var#ab}
@@ -7,7 +29,9 @@ echo ${var##a*b}
echo ${var#?}
echo ${var##?}
echo ${var#*}
-echo ${var##*}
+echo Empty:${var##*}
+echo ${var#}}_tail
+echo ${var#\}}_tail
echo ${var%cd}
echo ${var%%cd}
@@ -16,6 +40,13 @@ echo ${var%%c*d}
echo ${var%?}
echo ${var%%?}
echo ${var%*}
-echo ${var%%*}
+echo Empty:${var%%*}
+echo ${var#}}_tail
+echo ${var#\}}_tail
+echo ${var%\\*}
+
+a=ab}; echo ${a%\}};
+a=abc; c=c; echo ${a%${c}}
+a=ab{{c; echo ${a%`echo {{c`}
-echo end
+echo End