source: trunk/essentials/app-shells/bash/tests/new-exp5.sub

Last change on this file was 3228, checked in by bird, 18 years ago

bash 3.1

File size: 354 bytes
Line 
1x=(one two)
2echo ${x[@]:1}
3echo ${x[@]:0:1}
4
5x=(one)
6echo ${x[0]:1}
7echo ${x[0]:0}
8echo ${x[@]:1}
9echo ${x[@]:0}
10
11echo ${x[@]: -1}
12echo ${x[@]: ${#x[@]}-1}
13
14x=(0 1 2 3 4 5 6 7 8 9)
15echo ${x[@]:1}
16
17echo ${x[@]: -1}
18echo ${x[@]: ${#x[@]}-1}
19
20set -- ${x[@]}
21
22echo $1
23echo ${@: -1}
24echo ${@: $#-1}
25
26a=0123456789
27
28echo ${a:1}
29echo ${a: -1}
30echo ${a: ${#a}-1}
Note: See TracBrowser for help on using the repository browser.