#!/bin/sh
friend="$HOME/.friendlist"
friend2="$HOME/.friendlist2"

echo "Do you use me?---y/n"
read first
while test x"$first" = xy
do

w | grep -v pts | sort | sed 's/\([^ ]*\) :0\/\([^ ]*\) *[^ ]* *[^ ]* *[^ ]* *[^ ]* *[^ ]*/\1\2/' | cat >>$friend

read first
for i in $first
do
grep "$i" $friend | cat >>$friend2
set tmp=`sed 's/^c[0-9]\{6\} cs\([0-9]\{3\}\)/\1/' $friend2`
num=`$tmp >& /dev/null`
echo "
$i is here.
"
grep "$i" $friend2
echo ""
done