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.
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.