summaryrefslogtreecommitdiff
path: root/shell/ash_test/ash-vars/var_bash2.tests
diff options
context:
space:
mode:
authorDenis Vlasenko2008-03-25 07:49:43 +0000
committerDenis Vlasenko2008-03-25 07:49:43 +0000
commit80591b0a000e88c284bd2ec355f27e19e1da7528 (patch)
tree101b48a0a2c5506e6c818717c8ef7d66b857d6a7 /shell/ash_test/ash-vars/var_bash2.tests
parentb02cea12129f1aa484701317f38466ec9e1c8462 (diff)
downloadbusybox-80591b0a000e88c284bd2ec355f27e19e1da7528.zip
busybox-80591b0a000e88c284bd2ec355f27e19e1da7528.tar.gz
ash: support for && and || in [[ expr ]]; add testsuite checks
Diffstat (limited to 'shell/ash_test/ash-vars/var_bash2.tests')
-rwxr-xr-xshell/ash_test/ash-vars/var_bash2.tests24
1 files changed, 24 insertions, 0 deletions
diff --git a/shell/ash_test/ash-vars/var_bash2.tests b/shell/ash_test/ash-vars/var_bash2.tests
new file mode 100755
index 0000000..29c526c
--- /dev/null
+++ b/shell/ash_test/ash-vars/var_bash2.tests
@@ -0,0 +1,24 @@
+var=abc123dcba123
+
+echo ${var/d/x}
+echo ${var/c/x}
+echo ${var//c/x}
+echo ${var/[123]/x}
+echo ${var//[123]/x}
+echo ${var/c*/x}
+echo ${var/*c/x}
+
+# must match longest match: result is "abx23"
+echo ${var/c*1/x}
+
+# empty replacement - 2nd slash can be omitted
+echo ${var/[123]}
+echo ${var//[123]}
+
+### ash doesn't support
+### # match only at the beginning:
+### echo ${var/#a/x}
+### echo ${var/#b/x} # should not match
+### echo ${var//#b/x} # should not match
+### # match only at the end:
+### echo ${var/%3/x}