xref: /freebsd/bin/sh/tests/parameters/mail2.0 (revision a2f733abcff64628b7771a47089628b7327a88bd)
1# Test that an interactive shell accesses $MAIL.
2
3goodfile=/var/empty/sh-test-goodfile
4mailfile=/var/empty/sh-test-mailfile
5T=$(mktemp sh-test.XXXXXX) || exit
6ENV=$goodfile MAIL=$mailfile ktrace -i -f "$T" ${SH} +m -i </dev/null >/dev/null 2>&1
7if ! grep -q $goodfile "$T"; then
8	# ktrace problem
9	rc=0
10elif grep -q $mailfile "$T"; then
11	rc=0
12fi
13rm "$T"
14exit ${rc:-3}
15