]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - bin/sh/tests/execution/shellproc7.0
sh/tests: Add a second kind of binary scripts without #!
[FreeBSD/FreeBSD.git] / bin / sh / tests / execution / shellproc7.0
1 # $FreeBSD$
2 # Non-POSIX trickery that is widely supported,
3 # used by https://justine.lol/ape.html
4
5 T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit
6 trap 'rm -rf "${T}"' 0
7 printf "MZqFpD='\n\0'\n#'\"\necho this is a test\n" >"$T/testshellproc"
8 chmod 755 "$T/testshellproc"
9 PATH=$T:$PATH
10 [ "`testshellproc`" = "this is a test" ]