xref: /freebsd/bin/sh/tests/execution/path1.0 (revision b0d29bc47dba79f6f38e67eabadfb4b32ffd9390)
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