home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1935 / chatyell < prev    next >
Text File  |  1990-12-28  |  682b  |  26 lines

  1. :
  2. # chatyell tells someone to join the chat.
  3. # Written by D'Arcy J.M. Cain
  4. # $Id: chatyell,v 1.1 90/08/19 19:05:45 darcy Exp $
  5.  
  6. if [ $# -lt 1 ]
  7. then
  8.     echo "Usage: chatyell user"
  9. else
  10. # The following test isn't perfect.  If you want to chat
  11. # with user bill and he is not logged in but billy is then
  12. # the test shows bill as logged in.  I'm sure there is a
  13. # really easy way to find out if someone is logged in but
  14. # I just don't happen to know it.
  15.     if [ `who | awk "/$1/ {print \$1}" | wc -l` != 0 ]
  16.     then
  17.         write $1 <<- END_ECHO
  18.         $LOGNAME wants to chat with you.
  19.         Type chat at the prompt
  20.         END_ECHO
  21.         chat $2 $3 $4 $5 $6 $7 $8 $9
  22.     else
  23.         echo "$1 not currently logged on"
  24.     fi
  25. fi
  26.