Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!dino!ux1.cso.uiuc.edu!pequod.cso.uiuc.edu!dorner From: dorner@pequod.cso.uiuc.edu (Steve Dorner) Newsgroups: comp.sys.next Subject: Re: is there any way to Message-ID: <1990Mar29.185323.24288@ux1.cso.uiuc.edu> Date: 29 Mar 90 18:53:23 GMT References: <22303@netnews.upenn.edu> <1990Mar28.153439.6841@ee.rochester.edu> Sender: usenet@ux1.cso.uiuc.edu (News) Reply-To: dorner@pequod.cso.uiuc.edu (Steve Dorner) Distribution: na Organization: University of Illinois at Urbana-Champaign Lines: 35 In article <1990Mar28.153439.6841@ee.rochester.edu> deke@ee.rochester.edu (Dikran Kassabian) writes: >This algorithm needs some more stuff to make it work. You have to initialize >by tucking away the value of mtime originally read, you have to keep track >of the values of both whenever you decide to play the sound, you have to >choose a sleep(3) time within the loop, etc. But this could be coded in >an hour or two. Less if neatness doesn't count. > >Of course, this method requires an additional process for every user. Not >very nice. There's an easier way; just forward your mail to yourself and to sndplay, in your .forward file. Mine even (tries) to speak the message in the voice of the person who sent me the mail. % cat .forward dorner, "|/Users/Dorner/Apps/newmail" % cat /Users/Dorner/Apps/newmail #!/bin/sh from=`/usr/ucb/grep -i '^From:' | /usr/bin/tr 'A-Z' 'a-z' | /usr/ucb/head -1 | /bin/sed -e 's/[^ ]* //' -e 's/.*.*//' -e 's/([^)]*)//' -e 's/@.*//' -e 's/ .*//'` if test $from != "" -a -r /Users/Dorner/Sounds/$from".snd" ; then /usr/bin/sndplay /Users/Dorner/Sounds/$from".snd" else /usr/bin/sndplay /Users/Dorner/Sounds/mail.snd fi exit 0 % It's easy enough to add a check to see if you're logged in or not; my cube is in a room occupied only by me, so I don't bother. -- Steve Dorner, U of Illinois Computing Services Office Internet: s-dorner@uiuc.edu UUCP: {convex,uunet}!uiucuxc!dorner