]> git.saurik.com Git - apple/shell_cmds.git/blame - sh/tests/errors/bad-binary1.126
shell_cmds-203.tar.gz
[apple/shell_cmds.git] / sh / tests / errors / bad-binary1.126
CommitLineData
deb63bfb 1# $FreeBSD: head/bin/sh/tests/errors/bad-binary1.126 218320 2011-02-05 12:54:59Z jilles $
71aad674
A
2# Checking for binary "scripts" without magic number is permitted but not
3# required by POSIX. However, it is preferable to getting errors like
4# Syntax error: word unexpected (expecting ")")
5# from trying to execute ELF binaries for the wrong architecture.
6
7T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit
8trap 'rm -rf "${T}"' 0
9printf '\0echo bad\n' >"$T/testshellproc"
10chmod 755 "$T/testshellproc"
11PATH=$T:$PATH
12testshellproc 2>/dev/null