Using $MAIL in ksh

I'm trying to write a menu script in ksh to allow a user to find his/her mail path.

Display the mail file path")
print -n "Mail File Path: " $MAIL

It's not working although it works when I'm simply doing it from the command line. Also, I'm using the same formula to find the shell path $SHELL and it works.

Any suggestions?

I may be incorrect, but I believe that /bin/login sets the MAIL variable. It will be available in your login shell, but unless it's been exported, will not show up in subshells, such as your script.

You may need to post your script. Putting the following into a script works fine.

#!/bin/ksh
print "Mail file path: " $MAIL