what am i doing wrong here's code. i have a file that has names of users and i want to know when they log on and off.
while true
do
for X in "friends1"
do
if who | grep "$X"
then
echo "$X is logged in"
else
sleep 5
fi
echo who > on
if [ $X -ne on]
then
echo "$X is logged off"
else
else sleep 5
fi
done
done