#!/bin/zsh

if [ $# -eq 0 ]; then
echo -ne "\rPlease supply a nickname (exact or near match)";echo -ne "\rFormatting: /exec visit nickname"
exit 123
fi

echo -ne "\rSearching for " $1 "..."
echo " VISIT, " $ACCOUNT ": " $* >> etc/history
res=`grep $1 log | grep "name:icon:uid:login" | tail -1 | cut -b 1-19`
[ -z $res ] && echo -en "\rNot seen today." &&  exit 123
echo -ne "\rWe saw " $1 " on the " $res
echo -ne " for the last time.\r(if he is not currently logged on)"
