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