xref: /freebsd/bin/sh/tests/parameters/pwd1.0 (revision 8aac90f18aef7c9eea906c3ff9a001ca7b94f375)
1# Check that bogus PWD values are not accepted from the environment.
2
3cd / || exit 3
4failures=0
5[ "$(PWD=foo ${SH} -c 'pwd')" = / ] || : $((failures += 1))
6[ "$(PWD=/var/empty ${SH} -c 'pwd')" = / ] || : $((failures += 1))
7[ "$(PWD=/var/empty/foo ${SH} -c 'pwd')" = / ] || : $((failures += 1))
8[ "$(PWD=/bin/ls ${SH} -c 'pwd')" = / ] || : $((failures += 1))
9
10exit $((failures != 0))
11