summaryrefslogtreecommitdiffstats
path: root/test/bashisms/special-expansions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/bashisms/special-expansions.sh')
-rw-r--r--test/bashisms/special-expansions.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/bashisms/special-expansions.sh b/test/bashisms/special-expansions.sh
new file mode 100644
index 0000000..93a4f7f
--- /dev/null
+++ b/test/bashisms/special-expansions.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+set -- foo bar moo
+
+echo BASHISM: ${#@}
+echo BASHISM: ${#*}
+
+echo BASHISM: ${@%f*}
+echo BASHISM: ${*%f*}
+echo BASHISM: ${@%%f*}
+echo BASHISM: ${*%%f*}
+
+echo BASHISM: ${@#*o}
+echo BASHISM: ${*#*o}
+echo BASHISM: ${@##*o}
+echo BASHISM: ${*##*o}
+
+echo BASHISM: ${@/?/u}
+echo BASHISM: ${*/?/u}
+echo BASHISM: ${@/?/}
+echo BASHISM: ${*/?/}
+
+echo BASHISM: ${@:2}
+echo BASHISM: ${*:2}
+echo BASHISM: ${@:1:1}
+echo BASHISM: ${*:1:1}