I am trying to take the contents of a list list1
and loop through them comparing them to another list generated by finger
. When a name from list1
is found in finger
it should be removed from list1
.
for i in $(cat list1); do
if finger | grep $i
echo "$i is online"
sed '/$i/d' <list1 >templist
mv templist list1
fi
done
list1
does not change. Once the script has run, the contents of list1
are the same.
I think the problem has to do with the cat
at the beginning but I'm not sure.
Thanks, Ryan