opnsense-src/tools/regression/bin/sh/execution/hash1.0
Jilles Tjoelker ef0cb80dd4 sh: Forget all cached command locations on any PATH change.
POSIX requires this and it is simpler than the previous code that remembered
command locations when appending directories to PATH.

In particular,
  PATH=$PATH
is no longer a no-op but discards all cached command locations.
2011-02-05 14:01:46 +00:00

12 lines
190 B
Text

# $FreeBSD$
T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit
trap 'rm -rf "${T}"' 0
PATH=$T:$PATH
ls -ld . >/dev/null
cat <<EOF >"$T/ls"
:
EOF
chmod 755 "$T/ls"
PATH=$PATH
ls -ld .