source:
trunk/essentials/app-shells/bash/tests/new-exp5.sub
Last change on this file was 3228, checked in by , 18 years ago | |
---|---|
File size: 354 bytes |
Line | |
---|---|
1 | x=(one two) |
2 | echo ${x[@]:1} |
3 | echo ${x[@]:0:1} |
4 | |
5 | x=(one) |
6 | echo ${x[0]:1} |
7 | echo ${x[0]:0} |
8 | echo ${x[@]:1} |
9 | echo ${x[@]:0} |
10 | |
11 | echo ${x[@]: -1} |
12 | echo ${x[@]: ${#x[@]}-1} |
13 | |
14 | x=(0 1 2 3 4 5 6 7 8 9) |
15 | echo ${x[@]:1} |
16 | |
17 | echo ${x[@]: -1} |
18 | echo ${x[@]: ${#x[@]}-1} |
19 | |
20 | set -- ${x[@]} |
21 | |
22 | echo $1 |
23 | echo ${@: -1} |
24 | echo ${@: $#-1} |
25 | |
26 | a=0123456789 |
27 | |
28 | echo ${a:1} |
29 | echo ${a: -1} |
30 | echo ${a: ${#a}-1} |
Note:
See TracBrowser
for help on using the repository browser.