opnsense-src/bin/sh/tests/builtins/command14.0
Jilles Tjoelker ccd0a51fda sh: Write absolute path in command -vV and type
POSIX is pretty clear that command -v, command -V and type shall write
absolute pathnames. Therefore, we need to prepend the current directory's
name to relative pathnames.

This can happen either when PATH contains a relative pathname or when the
operand contains a slash but is not an absolute pathname.
2020-09-01 13:19:15 +00:00

9 lines
132 B
Text

# $FreeBSD$
r=`cd /bin && PATH=. command -V ls`
case $r in
*/bin/ls*|*/bin/./ls*) ;;
*)
echo "Unexpected result: $r"
exit 1
esac