pwd2.0 revision 206759
1# $FreeBSD: head/tools/regression/bin/sh/parameters/pwd2.0 206759 2010-04-17 14:35:46Z jilles $ 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