home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume26 / socket / rfinger.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1992-09-07  |  623 b   |  26 lines

  1. #!/bin/sh
  2. # $Header: rfinger.sh[1.2] Sun Aug 30 18:04:21 1992 nickel@cs.tu-berlin.de proposed $
  3. #
  4. # remote finger program using socket(1). Works similar to finger(1),
  5. # but can do only remote fingers.
  6.  
  7. # If you have my nslook program, you can determine the official name
  8. # of the host.
  9. #NSLOOK="nslook -o"
  10. NSLOOK=echo
  11.  
  12. if [ "$1" = -l ] ; then
  13.     long=/W ; shift
  14. fi
  15.  
  16. host=`echo $1 | sed -n 's/^.*@\([^@]*\)$/\1/p'`
  17.  
  18. if [ $# != 1 -o ! "$host" ] ; then
  19.     echo Usage: `basename $0` '[-l] [user]@host'
  20.     exit 1
  21. fi
  22.  
  23. ohost=`$NSLOOK $host`
  24. echo \[$ohost\]
  25. echo `echo $1 | sed -n 's/^\(.*\)@[^@]*$/\1/p'` $long | socket -c $host finger
  26.