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