csh question

Dylan Kaufman morgan at chaos.cs.brandeis.edu
Thu May 2 05:21:30 AEST 1991


Hi,

I am trying to write a script which will be run by cron and which will
notify me if someone somewhere is logged on.  What I mean by that is
that the script will check to see whether I am logged on (if not, it
doesn't need to bother...) and then (assuming I am) check to see
whether there is someone logged onto another account on another
computer.  If there is, it should then determine what tty I am logged
onto and either cat or write to my tty... the problem is that it
doesn't work...  I get mail from root saying that my cron output is 

stty: : Not a typewriter.

The same thing happens when I try having it send me mail rather than
using cat or write.

The code I have is as follows:

#!/bin/csh
set a=`f|fgrep -c morgan`
if ($a != 0) then
	set b=`finger @eris.berkeley.edu|fgrep -c morgan`
	if ($b != 0) then
		set c=`w morgan|fgrep morgan|cut -f4 -d' '`
		cat ~/cronfile > /dev/$c
	endif
endif

Any help would be appreciated.  

Thank you in advance,
--
-<>Dylan<>-                     MA EMT-M, CA EMT-1A, BEMCo 107
Dylan Kaufman 			Major in Computer Science
morgan at chaos.cs.brandeis.edu	Brandeis University, Waltham, MA
------<< Support your local Emergency Medical Services >>-------
"Don't ask me, I'm just improvising" -RUSH



More information about the Comp.unix.questions mailing list