xref: /freebsd/bin/sh/tests/errors/bad-binary1.126 (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
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