12a55badeSJilles Tjoelker# This tests a quality of implementation issue. 22a55badeSJilles Tjoelker# Shells are not required to reject executing binary files as shell scripts 32a55badeSJilles Tjoelker# but executing, for example, ELF files for a different architecture as 42a55badeSJilles Tjoelker# shell scripts may have annoying side effects. 52a55badeSJilles Tjoelker 62a55badeSJilles TjoelkerT=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit 72a55badeSJilles Tjoelkertrap 'rm -rf "${T}"' 0 82a55badeSJilles Tjoelkerprintf '\211PNG\015\012\032\012\0\0\0\015IHDR' >"$T/testshellproc" 92a55badeSJilles Tjoelkerchmod 755 "$T/testshellproc" 102a55badeSJilles TjoelkerPATH=$T:$PATH 112a55badeSJilles Tjoelkererrout=`testshellproc 3>&2 2>&1 >&3 3>&-` 122a55badeSJilles Tjoelkerr=$? 132a55badeSJilles Tjoelker[ "$r" = 126 ] && [ -n "$errout" ] 14