xref: /freebsd/bin/sh/tests/execution/path1.0 (revision fcb560670601b2a4d87bb31d7531c8dcc37ee71b)
1# $FreeBSD$
2# Some builtins should not be overridable via PATH.
3
4set -e
5T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX)
6trap 'rm -rf ${T}' 0
7echo '#!/bin/sh
8echo bad' >"$T/cd"
9chmod 755 "$T/cd"
10cd /bin
11oPATH=$PATH
12PATH=$T:$PATH:%builtin
13cd /
14PATH=$oPATH
15[ "$(pwd)" = / ]
16