]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/dstack2.tests
bash-5.0 distribution sources and documentation
[thirdparty/bash.git] / tests / dstack2.tests
CommitLineData
d233b485 1wdir=$PWD
cce855bc
JA
2cd /
3
4echo expect '~1'
5echo ~1
6
7pushd /usr
8pushd /tmp
9dirs
10
11echo these lines should be the same
12dirs +0
13echo ~0 ${DIRSTACK[0]}
14echo these lines should be the same
15dirs +1
16echo ~1 ${DIRSTACK[1]}
17echo these lines should be the same
18dirs +2
19echo ~2 ${DIRSTACK[2]}
20
21NDIRS=$(( ${#DIRSTACK[@]} - 1 ))
22
23echo these lines should be the same
24dirs -2
25echo ~-2 ${DIRSTACK[NDIRS-2]}
26
27echo these lines should be the same
28dirs -1
29echo ~-1 ${DIRSTACK[NDIRS-1]}
30dirs -v -1
31
32echo these lines should be the same
33dirs -0
34echo ~-0 ${DIRSTACK[NDIRS]}
d233b485
CR
35
36cd "$wdir"