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