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