xref: /freebsd/bin/sh/tests/execution/shellproc7.0 (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
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