X-Git-Url: https://git.saurik.com/apple/shell_cmds.git/blobdiff_plain/b5fe885ee63a0f46dc66d5ba8af23cad26f23e04..71aad6740de6ae0068511076140d8875bbed2a15:/sh/tests/errors/bad-binary1.126 diff --git a/sh/tests/errors/bad-binary1.126 b/sh/tests/errors/bad-binary1.126 new file mode 100644 index 0000000..d92e9de --- /dev/null +++ b/sh/tests/errors/bad-binary1.126 @@ -0,0 +1,12 @@ +# $FreeBSD$ +# Checking for binary "scripts" without magic number is permitted but not +# required by POSIX. However, it is preferable to getting errors like +# Syntax error: word unexpected (expecting ")") +# from trying to execute ELF binaries for the wrong architecture. + +T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit +trap 'rm -rf "${T}"' 0 +printf '\0echo bad\n' >"$T/testshellproc" +chmod 755 "$T/testshellproc" +PATH=$T:$PATH +testshellproc 2>/dev/null