NetBSD/regress/bin/sh/exitstatus.sh
simonb f34da8442c Add a regression test for testing that here documents don't confuse the
exit status of the previous command ($?).  Fixed long ago on -current,
but forgot to commit this test...
2003-09-13 09:35:56 +00:00

22 lines
177 B
Bash
Executable File

#!/bin/sh
check() {
if [ "$1" != "$2" ]
then
echo "expected [$2], found [$1]" 1>&2
exit 1
fi
}
crud() {
test yes = no
cat <<EOF
$?
EOF
}
foo=`crud`
check x$foo x1