LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 12-26-2005, 11:50 PM   #1
MicroAutoDev
LQ Newbie
 
Registered: Dec 2005
Location: Spring, Texas USA
Distribution: Debian
Posts: 1

Rep: Reputation: 0
Want my own mailcheck routine in bash


Hello,

I wonder if anyone can tell me how to change the routine that is used by bash for checking mail. I am using fetchmail and alias files to load mail into a database. I would like to replace whatever it is that bash does every $MAILCHECK seconds to check for mail. I want to use my own code so it can check the database to determine if the user has new mail.

Any ideas?

I am running Debian 3.1.

Thanks
 
Old 12-27-2005, 01:01 AM   #2
cyberjun
Member
 
Registered: Mar 2005
Distribution: Gentoo kernel 2.6.14
Posts: 96

Rep: Reputation: 15
Hi,
From the bash man page:
Code:
       MAIL   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).
Hope this helps. I think you will have to somehow change timestamps on a particular file whenever new mail comes.

cheers,
--cyberjun
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
encryption in CGI routine rblampain Linux - Security 3 08-12-2005 10:55 PM
Interrupt routine... Elric of Grans Programming 2 07-05-2005 07:11 PM
Thunderbird as XFce mailcheck applet client? r_jensen11 Linux - Software 0 07-29-2004 08:17 PM
bash: routine outputting both matches and non-matches separately??? Bebo Programming 8 07-19-2004 06:52 AM
About startup routine eshwar_ind Programming 18 05-23-2004 02:01 AM


All times are GMT -5. The time now is 07:11 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration