home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / alt / sources / 3081 < prev    next >
Encoding:
Text File  |  1993-01-24  |  1.6 KB  |  39 lines

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