sh: Add test for shell script without '#!'.

This commit is contained in:
Jilles Tjoelker 2011-02-02 22:03:18 +00:00
parent 3e0b768c63
commit 0df2165c11

View File

@ -0,0 +1,11 @@
# $FreeBSD$
T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit
trap 'rm -rf "${T}"' 0
cat <<EOF >"$T/testshellproc"
printf 'this '
echo is a test
EOF
chmod 755 "$T/testshellproc"
PATH=$T:$PATH
[ "`testshellproc`" = "this is a test" ]