home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: alt.sources
- Path: sparky!uunet!mcsun!news.funet.fi!ousrvr.oulu.fi!phoenix!yaz
- From: yaz@phoenix.oulu.fi
- Subject: mwrite - write multiple users on your host, script in csh
- Message-ID: <1993Jan24.224248.3491@ousrvr.oulu.fi>
- Lines: 27
- Sender: news@ousrvr.oulu.fi
- Organization: Phoenix Lab., University of Oulu, Finland
- X-Newsagent: :: uutimet -- news-agent by yaz@phoenix.oulu.fi ::
- Date: Sun, 24 Jan 1993 22:42:48 GMT
-
- #!/bin/csh
- # mwrite was written by yaz@phoenix.oulu.fi (Tuomas K Kaikkonen)
- #
- # Usage: mwrite username(s)
- # Use Ctrl-D (EOF) to mark the end of the message.
- #
- # Usage2 example: cat file | mwrite username(s)
-
- set xpro="/tmp/`whoami`$$" # The temporary file, choose whatever directory
- cp /dev/null $xpro # Empty it by copying the null-file over it
- set xline=" " # Initialize the input line variable by one space
- while (`echo -n "$xline" | wc -c`) # stay in loop until empty line (EOF)
- set xline="$<" # read stdin into the input line variable
- echo "$xline" >> $xpro # add the line to the temporary file
- end # end loop
- foreach xto (`echo $*`) # for each of the user
- write $xto < $xpro # write the temporary file to them
- end # and end the foreach
- rm $xpro # remove the temporary file
-
- #--
- #Tuomas K.Kaikkonen yaz@phoenix.oulu.fi ,._/\ " % man woman "
- #Taidonkaari 1 E 36 Tel:+358-81-5546081 `. | " woman not found "
- #SF-90570 OULU (_/ _ __ /FI| " % wife ? "
- #FINLAND I I-I /_ |___/ " wife: No match. "
-
-
-