diff options
Diffstat (limited to 'shell/hush_test/hush-vars/param_expand_bash_substring.tests')
-rwxr-xr-x | shell/hush_test/hush-vars/param_expand_bash_substring.tests | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/shell/hush_test/hush-vars/param_expand_bash_substring.tests b/shell/hush_test/hush-vars/param_expand_bash_substring.tests index a80523a..5c9552d 100755 --- a/shell/hush_test/hush-vars/param_expand_bash_substring.tests +++ b/shell/hush_test/hush-vars/param_expand_bash_substring.tests @@ -55,6 +55,21 @@ f=0123456789; echo "f::2 =|${f::2}|" f=0123456789; echo "f:1: =|${f:1:}|" f=0123456789; echo "f:: =|${f::}|" +echo "Substrings from special vars" +echo '? '"=|$?|" +echo '?:1 '"=|${?:1}|" +echo '?:1:2'"=|${?:1:2}|" +echo '?::2 '"=|${?::2}|" +echo '?:1: '"=|${?:1:}|" +echo '?:: '"=|${?::}|" +set -- 1 2 3 4 5 6 7 8 9 10 11 +echo '# '"=|$#|" +echo '#:1 '"=|${#:1}|" +echo '#:1:2'"=|${#:1:2}|" +echo '#::2 '"=|${#::2}|" +echo '#:1: '"=|${#:1:}|" +echo '#:: '"=|${#::}|" + echo "Substrings with expressions" f=01234567; echo 'f '"=|$f|" f=01234567; echo 'f:1+1:2+2 '"=|${f:1+1:2+2}|" |