if [ -e $HOME/icq.tmp ] then me=`awk '{print $3}' $HOME/icq.tmp` if [ "$metty" = "$me" ] then yourtty=`awk '{print $2}' $HOME/icq.tmp` yourname=`awk '{ if ($2=="'$yourtty'") print $3}' $HOME/user.dat` mename=`awk '{if ($2=="'metty'") print $3}' $HOME/user.dat` mexh=`awk '{if ($2=="'metty'") print $1}' $HOME/user.dat` clear mesg -y echo "\n 你正与 ${yourname} 聊天\n " echo "\n ${mename} 正与你聊天,请选择 ${mexh} 与之对聊\n" >/dev/$yourtty /tcb/bin/asroot write $icqname $yourtty exit 0 fi fi
while : do clear who | awk '{print $1,$2}' >$HOME/talk.temp sed '/'"$metty"'/d;/^#/d' $HOME/user.dat |awk 'BEGIN{printf("\n%-5s%-10s%-16s\n"),"序号","TTY","用户名"} \ {printf("%-5s%-10s%-16s\n"),$1,$2,$3}'