summaryrefslogtreecommitdiff
path: root/bin/sh/tests/execution/shellproc7.0
blob: b5e543826c8a3958f112aadce19fb71f25434498 (plain)
1
2
3
4
5
6
7
8
9
# Non-POSIX trickery that is widely supported,
# used by https://justine.lol/ape.html

T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit
trap 'rm -rf "${T}"' 0
printf "MZqFpD='\n\0'\n#'\"\necho this is a test\n" >"$T/testshellproc"
chmod 755 "$T/testshellproc"
PATH=$T:$PATH
[ "`testshellproc`" = "this is a test" ]