xref: /freebsd/bin/sh/tests/parameters/pwd2.0 (revision a64729f5077d77e13b9497cb33ecb3c82e606ee8)
1# Check that PWD is exported and accepted from the environment.
2set -e
3
4T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX)
5trap 'rm -rf $T' 0
6cd -P $T
7TP=$(pwd)
8mkdir test1
9ln -s test1 link
10cd link
11[ "$PWD" = "$TP/link" ]
12[ "$(pwd)" = "$TP/link" ]
13[ "$(pwd -P)" = "$TP/test1" ]
14[ "$(${SH} -c pwd)" = "$TP/link" ]
15[ "$(${SH} -c pwd\ -P)" = "$TP/test1" ]
16cd ..
17[ "$(pwd)" = "$TP" ]
18cd -P link
19[ "$PWD" = "$TP/test1" ]
20[ "$(pwd)" = "$TP/test1" ]
21[ "$(pwd -P)" = "$TP/test1" ]
22[ "$(${SH} -c pwd)" = "$TP/test1" ]
23[ "$(${SH} -c pwd\ -P)" = "$TP/test1" ]
24