]>
Commit | Line | Data |
---|---|---|
d233b485 | 1 | wdir=$PWD |
cce855bc JA |
2 | cd / |
3 | ||
4 | echo expect '~1' | |
5 | echo ~1 | |
6 | ||
7 | pushd /usr | |
8 | pushd /tmp | |
9 | dirs | |
10 | ||
11 | echo these lines should be the same | |
12 | dirs +0 | |
13 | echo ~0 ${DIRSTACK[0]} | |
14 | echo these lines should be the same | |
15 | dirs +1 | |
16 | echo ~1 ${DIRSTACK[1]} | |
17 | echo these lines should be the same | |
18 | dirs +2 | |
19 | echo ~2 ${DIRSTACK[2]} | |
20 | ||
21 | NDIRS=$(( ${#DIRSTACK[@]} - 1 )) | |
22 | ||
23 | echo these lines should be the same | |
24 | dirs -2 | |
25 | echo ~-2 ${DIRSTACK[NDIRS-2]} | |
26 | ||
27 | echo these lines should be the same | |
28 | dirs -1 | |
29 | echo ~-1 ${DIRSTACK[NDIRS-1]} | |
30 | dirs -v -1 | |
31 | ||
32 | echo these lines should be the same | |
33 | dirs -0 | |
34 | echo ~-0 ${DIRSTACK[NDIRS]} | |
d233b485 CR |
35 | |
36 | cd "$wdir" |