xref: /freebsd/bin/sh/tests/parameters/mail2.0 (revision ab0b9f6b3073e6c4d1dfbf07444d7db67a189a96)
1# $FreeBSD$
2# Test that an interactive shell accesses $MAIL.
3
4goodfile=/var/empty/sh-test-goodfile
5mailfile=/var/empty/sh-test-mailfile
6T=$(mktemp sh-test.XXXXXX) || exit
7ENV=$goodfile MAIL=$mailfile ktrace -i -f "$T" ${SH} +m -i </dev/null >/dev/null 2>&1
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