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