![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Internet Explorer is infected - small windows keep popping up | milhan | Windows & DOS: Issues & Discussions | 17 | 09-06-2009 03:00 PM |
| cron job starts new cron proccess | ron76 | SUN Solaris | 3 | 05-12-2008 02:07 AM |
| CRON usage for CRON job | skyineyes | UNIX for Dummies Questions & Answers | 1 | 01-17-2008 10:17 AM |
| AIX and cron logs filtering ?: /etc/cronlog.conf, /var/adm/cron/log | Keith Johnson | AIX | 0 | 01-09-2008 08:32 PM |
| Cron : you are not authorized to use cron. Sorry. | tt155 | UNIX for Advanced & Expert Users | 1 | 07-06-2005 11:37 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Fetchmal email notif. on your prompt (pop, imap, etrn, odmr) [fixed]
Maybe this can help you (I'm refering to the previous post) This is my question: ============= 1- I am using fetchmail 2- fetchmail allows you to "check" but not "fetch" with the -c flag 3- I thought I'd write a script to check for email, so that I get a text message on my terminal when I get an email (because it's IMAP) This is the script: Code:
#!/usr/bin/env zsh
if echo `fetchmail -c -f ~path/to/my/fetchmailrc`| grep -q 'message'; then
exit
else
missatge=$(echo `fetchmail -c -f ~path/to/my/fetchmail/fetchmailrc` | gawk '{print "you have "$2" "$3" waiting, my dear..."}')
echo -e "\033[34m\033[1m$missatge"
fi
This is my cronjob: Code:
0-59/1 * * * * $HOME/bin/fetchmailnotification.sh I have tested the script and it works just right. However the cronjob is not showing anything. I thought it could be the > /dev/null or the > /dev/null 2>&1 if you want no e-mail ever. I've tried removing these > but nothing I was expecting to be prompted with the notification in my terminal whenever (after checking, say, once per minute, as stated in the cronjob) an email arrives but nothing... any hint? thanks Pau Last edited by pau; 02-03-2007 at 04:59 PM.. |
|
|||||
|
Quote:
Code:
echo "whatever" | write userX pts/X Obviously you need to "guess" the terminal, but you can get that info from "who"... ![]() Regards. |
|
||||
|
Hi grial, that's a promising thing indeed! now my who yields Code:
elachistos| who pau :0 2006-12-12 11:43 pau pts/0 2006-12-12 11:44 (:0.0) pau pts/1 2006-12-12 12:29 (:0.0) pau pts/2 2006-12-12 13:54 (:0.0) pau pts/4 2006-12-12 13:58 (:0.0) because I have opened 4 tabs on a terminal... mmmh... I guess I could define a variable called pts and do a grep on "who" to have sent the message to all terminals... let me try it thanks for the hint (I wasn't aware of write, by the way! nice BSD tool!) |
|
||||
|
Mmmh... there's a little problem... write is verbose Code:
elachistos| Message from pau@elachistos on pts/2 at 14:20 ... ^[[34m^[[1mhola EOF and it doesn't understand the colour encoding (well, that's not very important, but I don't really like the "Message from blabla" and "EOF" ... from the man it seems it's not possible to make it silent...
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|