xref: /freebsd/bin/sh/tests/errors/bad-binary1.126 (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1# Checking for binary "scripts" without magic number is permitted but not
2# required by POSIX. However, it is preferable to getting errors like
3# Syntax error: word unexpected (expecting ")")
4# from trying to execute ELF binaries for the wrong architecture.
5
6T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit
7trap 'rm -rf "${T}"' 0
8printf '\0echo bad\n' >"$T/testshellproc"
9chmod 755 "$T/testshellproc"
10PATH=$T:$PATH
11testshellproc 2>/dev/null
12