Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-29-2010, 08:17 AM   #1
Senior Member
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,546

Rep: Reputation: 57
Bash: How to use $(fetchmail | head -n 1) to make a beep at any new email received?


How to watch and make a beep at change of the output : fetchmail -k | head -n 1 ? What could be the best way in bash ?

Last edited by frenchn00b; 05-29-2010 at 08:20 AM.
Old 05-29-2010, 09:36 AM   #2
Registered: Jun 2008
Location: Belgium
Distribution: Debian
Posts: 109

Rep: Reputation: 42
Something like :
while true
  fetchmail -ks && beep
  sleep 300
fetchmail exit status is 0 if there is new mail and non zero if no new mail or error.
I don't know if you want your fetchmail to actually *fetch* the mail. But if don't want to, use 'fetchmail -cs' instead of '-k' so that it only check if there is new mail.
beep can be the one of the beep command (package beep on debian) with customized beeps.

Hope this helps.


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
receive and parse email in bash (or execute script when message is received) Guyverix Linux - Newbie 2 11-15-2009 07:29 AM
Beating my head against the email wall - cannot receive email dazed-and-confused Linux - Server 16 09-02-2008 05:14 AM
Pipe'ing the ouput of 'cat' into 'mutt' (email) losses newlines when email received helptonewbie Linux - Newbie 2 08-28-2008 03:16 AM
Archiving both received and sent email? neocookie Linux - Server 3 09-26-2007 09:13 AM
How do I: convert my fetchmail email file to separate email files? ancientt Linux - Software 1 02-03-2003 02:14 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:53 AM.

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