It's the way that grep dumps the data pipe into standard out.
Give who | sort >> user.txt a try and I bet it works for you.
You're going to need to write a quick hack in perl to open a file
and then dump all standard input to it. Stick that in place of
the >> yourfile in your pipe chain. tail | grep | hack.pl
...or spend all day pulling your hair out searching for an answer
you probably won't find.
