]> git.saurik.com Git - apple/shell_cmds.git/blobdiff - sh/tests/parameters/mail2.0
shell_cmds-198.tar.gz
[apple/shell_cmds.git] / sh / tests / parameters / mail2.0
diff --git a/sh/tests/parameters/mail2.0 b/sh/tests/parameters/mail2.0
new file mode 100644 (file)
index 0000000..343c99d
--- /dev/null
@@ -0,0 +1,15 @@
+# $FreeBSD$
+# Test that an interactive shell accesses $MAIL.
+
+goodfile=/var/empty/sh-test-goodfile
+mailfile=/var/empty/sh-test-mailfile
+T=$(mktemp sh-test.XXXXXX) || exit
+ENV=$goodfile MAIL=$mailfile ktrace -i -f "$T" ${SH} +m -i </dev/null >/dev/null 2>&1
+if ! grep -q $goodfile "$T"; then
+       # ktrace problem
+       rc=0
+elif grep -q $mailfile "$T"; then
+       rc=0
+fi
+rm "$T"
+exit ${rc:-3}