xref: /freebsd/bin/sh/tests/execution/shellproc7.0 (revision 8b959dd6a3921c35395bef4a6d7ad2426a3bd88e)
1# $FreeBSD$
2# Non-POSIX trickery that is widely supported,
3# used by https://justine.lol/ape.html
4
5T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit
6trap 'rm -rf "${T}"' 0
7printf "MZqFpD='\n\0'\n#'\"\necho this is a test\n" >"$T/testshellproc"
8chmod 755 "$T/testshellproc"
9PATH=$T:$PATH
10[ "`testshellproc`" = "this is a test" ]
11