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
signature.asc
Description: Digital signature
_______________________________________________ screen-users mailing list [email protected] http://lists.gnu.org/mailman/listinfo/screen-users
