Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Thanks, but that doesn't seem to say anything about enabling the "you have new mail" message. The mail system is working fine, but I have to type 'mail' each time I log in to check. I was just trying to get the new mail message to appear on login...
If this parameter is set to a file name and the MAILPATH variable is not set, bash informs the user of the arrival of mail in the specified file.
MAILCHECK
Specifies how often (in seconds) bash checks for mail. The default is 60 seconds. When it is time to check for mail, the shell does so before displaying the primary prompt. If this variable is unset, or set to a value that is not a number greater than or equal to zero, the shell disables mail checking.
MAILPATH
A colon-separated list of file names to be checked for mail. The message to be printed when mail arrives in a particular file may be specified by separating the file name from the message with a '?'. When used in the text of the message, $_ expands to the name of the current mailfile. Example:
MAILPATH='/var/mail/bfox?"You have mail":~/shell-mail?"$_ has mail!"'
Bash supplies a default value for this variable, but the location of the user mail files that it uses is system dependent (e.g., /var/mail/$USER).
I'm trying to get the system to check and tell me as soon as I log in.
MAILPATH tells it where to check
MAILCHECK tells it how often to check
These are already set correct:
[root@GDServer ~]# env | grep MAIL
MAILCHECK=60
MAIL=/var/spool/mail/root
What the system doesn't do is tell me when I log in.
E.g.
As things are now:
login as: root
root@192.168.1.12's password:
Last login: Wed May 9 19:57:18 2012 from 192.168.1.7
[root@GDServer ~]# mailx
Heirloom Mail version 12.5 7/5/10. Type ? for help.
"/var/spool/mail/root": 4 messages 2 new 3 unread
U 1 root Wed May 9 18:01 20/771
2 Cron Daemon Wed May 9 19:48 27/1188 "Cron <root@GDServer> "
>N 3 wdtv box Wed May 9 22:55 29/1012 "virus-scan.05-09-12"
N 4 root Thu May 10 06:01 29/1021 "virus-scan.05-10-12"
& q
[root@GDServer ~]#
What I would like:
login as: root
root@192.168.1.12's password:
Last login: Wed May 9 19:57:18 2012 from 192.168.1.7 You have new mail!
[root@GDServer ~]#
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.