xref: /freebsd/bin/sh/tests/parameters/mail1.0 (revision 0d66206fff44f864ea8a4b220c3a53b4caa959a0)
1# $FreeBSD$
2# Test that a non-interactive shell does not access $MAIL.
3
4goodfile=/var/empty/sh-test-goodfile
5mailfile=/var/empty/sh-test-mailfile
6T=$(mktemp sh-test.XXXXXX) || exit
7MAIL=$mailfile ktrace -i -f "$T" ${SH} -c "[ -s $goodfile ]" 2>/dev/null
8if ! grep -q $goodfile "$T"; then
9	# ktrace problem
10	rc=0
11elif ! grep -q $mailfile "$T"; then
12	rc=0
13fi
14rm "$T"
15exit ${rc:-3}
16