Line | |
---|
1 | cd /
|
---|
2 |
|
---|
3 | echo expect '~1'
|
---|
4 | echo ~1
|
---|
5 |
|
---|
6 | pushd /usr
|
---|
7 | pushd /tmp
|
---|
8 | dirs
|
---|
9 |
|
---|
10 | echo these lines should be the same
|
---|
11 | dirs +0
|
---|
12 | echo ~0 ${DIRSTACK[0]}
|
---|
13 | echo these lines should be the same
|
---|
14 | dirs +1
|
---|
15 | echo ~1 ${DIRSTACK[1]}
|
---|
16 | echo these lines should be the same
|
---|
17 | dirs +2
|
---|
18 | echo ~2 ${DIRSTACK[2]}
|
---|
19 |
|
---|
20 | NDIRS=$(( ${#DIRSTACK[@]} - 1 ))
|
---|
21 |
|
---|
22 | echo these lines should be the same
|
---|
23 | dirs -2
|
---|
24 | echo ~-2 ${DIRSTACK[NDIRS-2]}
|
---|
25 |
|
---|
26 | echo these lines should be the same
|
---|
27 | dirs -1
|
---|
28 | echo ~-1 ${DIRSTACK[NDIRS-1]}
|
---|
29 | dirs -v -1
|
---|
30 |
|
---|
31 | echo these lines should be the same
|
---|
32 | dirs -0
|
---|
33 | echo ~-0 ${DIRSTACK[NDIRS]}
|
---|
Note:
See
TracBrowser
for help on using the repository browser.