summaryrefslogtreecommitdiff
path: root/shell/ash_test/ash-vars/param_expand_alt.tests
diff options
context:
space:
mode:
authorDenys Vlasenko2017-07-26 00:30:02 +0200
committerDenys Vlasenko2017-07-26 00:30:02 +0200
commitb0648b0e7874e8551df64708532346a049ab7f2c (patch)
treec70d819fe4a2ccae0fe4573d3a2f8fc038af9f04 /shell/ash_test/ash-vars/param_expand_alt.tests
parent2093ad296f8a4528ad0e106b52074871a2bf070e (diff)
downloadbusybox-b0648b0e7874e8551df64708532346a049ab7f2c.zip
busybox-b0648b0e7874e8551df64708532346a049ab7f2c.tar.gz
shell: remove ${#+} tests, it is not a valid construct
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test/ash-vars/param_expand_alt.tests')
-rwxr-xr-xshell/ash_test/ash-vars/param_expand_alt.tests9
1 files changed, 7 insertions, 2 deletions
diff --git a/shell/ash_test/ash-vars/param_expand_alt.tests b/shell/ash_test/ash-vars/param_expand_alt.tests
index d804524..23e9a26 100755
--- a/shell/ash_test/ash-vars/param_expand_alt.tests
+++ b/shell/ash_test/ash-vars/param_expand_alt.tests
@@ -6,8 +6,13 @@
# now some funky ones.
# ${V+word} "if V unset, then substitute nothing, else substitute word"
# ${V:+word} "if V unset or '', then substitute nothing, else substitute word"
-# bash doesn't accept ${#+}. ash prints 0 (not $#): "len of $+"
-echo _${#+}_ _${#:+}_
+#
+# ${#:+} is a :+ op on $#, but ${#+} (and any other ${#c}) is "length of $c",
+# not + op on $#.
+# bash and dash do not accept ${#+}. it's possible for some shell to skip
+# the check that c is valid and interpret ${#+} as "len of $+". Not testing it.
+# echo _${#+}_
+echo _${#:+}_
# Forms with non-empty word work as expected in both ash and bash.
echo _${#+z}_ _${#:+z}_