File: rfinger.sh

package info (click to toggle)
socket 1.1-10
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, squeeze, stretch, wheezy
  • size: 128 kB
  • ctags: 81
  • sloc: ansic: 947; makefile: 159; sh: 18
file content (25 lines) | stat: -rw-r--r-- 623 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# $Header: rfinger.sh[1.2] Sun Aug 30 18:04:21 1992 nickel@cs.tu-berlin.de proposed $
#
# remote finger program using socket(1). Works similar to finger(1),
# but can do only remote fingers.

# If you have my nslook program, you can determine the official name
# of the host.
#NSLOOK="nslook -o"
NSLOOK=echo

if [ "$1" = -l ] ; then
	long=/W ; shift
fi

host=`echo $1 | sed -n 's/^.*@\([^@]*\)$/\1/p'`

if [ $# != 1 -o ! "$host" ] ; then
	echo Usage: `basename $0` '[-l] [user]@host'
	exit 1
fi

ohost=`$NSLOOK $host`
echo \[$ohost\]
echo `echo $1 | sed -n 's/^\(.*\)@[^@]*$/\1/p'` $long | socket -c $host finger