1218320Sjilles# $FreeBSD$
2218320Sjilles# Checking for binary "scripts" without magic number is permitted but not
3218320Sjilles# required by POSIX. However, it is preferable to getting errors like
4218320Sjilles# Syntax error: word unexpected (expecting ")")
5218320Sjilles# from trying to execute ELF binaries for the wrong architecture.
6218320Sjilles
7218320SjillesT=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit
8218320Sjillestrap 'rm -rf "${T}"' 0
9218320Sjillesprintf '\0echo bad\n' >"$T/testshellproc"
10218320Sjilleschmod 755 "$T/testshellproc"
11218320SjillesPATH=$T:$PATH
12218320Sjillestestshellproc 2>/dev/null
13