9fans archive / 1995 / 03 / 6 /    prev next

From: Scott Schwartz schwartz@gal...
Subject: finger
Date: Thu, 2 Mar 1995 23:47:16 -0500

Here's a quick and dirty finger client, if anyone is interested.
(There is a carrage return in that final sed.  Hopefully not too
many mailers will spoil it.)

#!/bin/rc
~ $#* 0 && { echo 'usage: finger host[!user]' >[1=2] ; exit usage }

ifs='!
' *=`{echo $1}

ifs=' 	
' cs=`{echo tcp!$1!finger | ndb/csquery} 
~ $#cs 2 && exit # blech, prompts; need a nicer csquery
remote=$cs(3)

< /net/tcp/clone {
  n=`{read}
  local=/net/tcp/$n
  echo '[' $local '<' $remote ']' >[1=2]
  echo connect $remote >$local/ctl
  echo $2 >$local/data
  cat <$local/data
} | sed 's/
$//'