]> git.saurik.com Git - apple/shell_cmds.git/blob - sh/tests/execution/path1.0
shell_cmds-216.60.1.tar.gz
[apple/shell_cmds.git] / sh / tests / execution / path1.0
1 # $FreeBSD: head/bin/sh/tests/execution/path1.0 217206 2011-01-09 21:07:30Z jilles $
2 # Some builtins should not be overridable via PATH.
3
4 set -e
5 T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX)
6 trap 'rm -rf ${T}' 0
7 echo '#!/bin/sh
8 echo bad' >"$T/cd"
9 chmod 755 "$T/cd"
10 cd /bin
11 oPATH=$PATH
12 PATH=$T:$PATH:%builtin
13 cd /
14 PATH=$oPATH
15 [ "$(pwd)" = / ]