diff options
| author | Peter Stephenson <pws@users.sourceforge.net> | 2010-11-18 13:57:18 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@users.sourceforge.net> | 2010-11-18 13:57:18 +0000 |
| commit | 8f20b2361cc2e3911ba67b92f6aa89e7457d17de (patch) | |
| tree | b65be3bf863eb33c6118d0b6326be99832049684 /Test | |
| parent | 28418: add ${NAME:OFFSET:LENGTH} substitution (diff) | |
| download | zsh-8f20b2361cc2e3911ba67b92f6aa89e7457d17de.tar zsh-8f20b2361cc2e3911ba67b92f6aa89e7457d17de.tar.gz zsh-8f20b2361cc2e3911ba67b92f6aa89e7457d17de.tar.bz2 zsh-8f20b2361cc2e3911ba67b92f6aa89e7457d17de.tar.lz zsh-8f20b2361cc2e3911ba67b92f6aa89e7457d17de.tar.xz zsh-8f20b2361cc2e3911ba67b92f6aa89e7457d17de.tar.zst zsh-8f20b2361cc2e3911ba67b92f6aa89e7457d17de.zip | |
28419: Doc/Zsh/expn.yo, Src/subst.c, Test/D04parameter.ztst:
KSH_ARRAY ${*:0:1} gives $0, etc.
Diffstat (limited to 'Test')
| -rw-r--r-- | Test/D04parameter.ztst | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst index 7c6a465af..46565a121 100644 --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -1302,3 +1302,32 @@ >6 >9 >1 2 3 4 5 6 7 8 9 + + testfn() { + emulate -L sh + set -A foo 1 2 3 + set -- 1 2 3 + str=abc + echo ${foo[*]:0:1} + echo ${foo[*]:1:1} + echo ${foo[*]: -1:1} + : + echo ${*:0:1} + echo ${*:1:1} + echo ${*: -1:1} + : + echo ${str:0:1} + echo ${str:1:1} + echo ${str: -1:1} + } + testfn +0:Bash-style subscripts, Bourne-style indexing +>1 +>2 +>3 +>testfn +>1 +>3 +>a +>b +>c |
