screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [monitoring-like] would like to be warned when I have mail (fetchmai


From: Gerhard Siegesmund
Subject: Re: [monitoring-like] would like to be warned when I have mail (fetchmail -c)
Date: Wed, 28 Sep 2005 00:10:56 +0200
User-agent: Mutt/1.5.10i

Hello

I did something similar, but asking an imap-Server for the number of
mails with fetchmail -c. Problem was: The query took several seconds to
succeed, in which time my screen freezed as the hardstatusline was
waiting for the info.

I read the manpage and found "backtick 1 0 0 script" which is supposed
to start the script and just wait for new messages to stdout to output
them on the hardstatusline. Works great! Except for one thing: The
script doesn't get killed, if the screen is ended. This means I have to
stop the mailcheck-scripts which are created from screen by hand.

Is there anything I can do to automatically stop the started scripts if
the parent-screen is terminated?

> This seems to be a good opportunity to make use of the hardstatus
> and backticks. I agree a script is the right idea; here's how I'd do
> it.
>     $ cat ~/bin/screen-checkmail
>     #!/bin/sh
>     fetchmail -c $OTHER_FETCHMAIL_JIGGERY_POKERY
>     [parse fetchmail output reasonably]
>     
>     $ cat ~/.screenrc
>     ...
>     backtick 1 60 1 /$HOME/bin/screen-checkmail
>     ...
>     hardstatus alwayslastline ...%1`...
> Adding a conditional wrapper around your mail checker (eg %?...%?)
> will ensure that you only see your mail alert when your checkmail
> script produces output.

-- 
cu
  --== Jerri ==--
Homepage: http://www.jerri.de/   ICQ: 54160208
Public PGP Key: http://www.jerri.de/jerris_public_key.asc

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]