]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/exec10.sub
commit bash-20150605 snapshot
[thirdparty/bash.git] / tests / exec10.sub
CommitLineData
1573ba78
CR
1# post bash-4.3 changes to how command -p works (avoid modifying $PATH)
2
3: ${TMPDIR=/tmp}
4xpath=/usr/local/bin:/usr/GNU/bin:/usr/bin:/bin:.
5
6# set a value of PATH we can test for; versions of bash up to and including
7# bash-4.3 would set $PATH while running command -p
8PATH=$xpath
9export PATH
10command -p sh -c 'echo $PATH'
11
12PATH=${TMPDIR}
13command -pv cat >/dev/null || echo "cannot find cat using standard path"
14command -p cat < /dev/null
15#hash
16
17PATH=$xpath
18command -pv cat >/dev/null || echo "cannot find cat using xpath"
19PATH=$TMPDIR command -pv cat >/dev/null || echo "cannot find cat using standard path with PATH=\$TMPDIR"
20PATH= command -pv cat >/dev/null || echo "cannot find cat using standard path with empty \$PATH"
21PATH=$TMPDIR command -v cat >/dev/null || echo "cannot find cat in \$TMPDIR"
22PATH= command -v cat >/dev/null || echo "cannot find cat with empty \$PATH"
23
24echo PATH = $PATH
25hash cat
26
27PATH=$xpath
28
29PATH=$TMPDIR command -pv cat >/dev/null || echo "cannot find cat using stdpath with hash"
30PATH= command -pv cat >/dev/null || echo "cannot find cat using stdpath with hash"
31PATH=$TMPDIR command -v cat >/dev/null || echo "cannot find cat in \$TMPDIR with hash"
32PATH= command -v cat >/dev/null || echo "cannot find cat with empty \$PATH with hash"
33
34echo PATH = $PATH