xref: /freebsd/bin/sh/tests/parameters/pwd2.0 (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
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