Program:
if test $# -lt 1
then
echo "no argument supplied"
exit
fi
logname=$1
time=0
while true
do
who |grep "$logname">/dev/null
if test $? -eq 0
then
echo $logname has logged in
if test $time -ne 0
then
echo "he is $time minutes late"
fi
exit
else
time=`expr $time + 1`
sleep 60
fi
done
Input/OutPut
no argument supplied
No comments:
Post a Comment