This Week's Useless Use of Cat Award goes to
Nick> cat file | sort | uniq > newfile
And of course, if you've been following along for a week or two, you know
that this (BING!) is a Useless Use of Cat!
Rememeber, nearly all cases where you have:
cat file | some_command and its args ...
you can rewrite it as:
<file some_command and its args ...
and in some cases, such as this one, you can move the filename
to the arglist as in:
some_command and its args ... file
Of course, the real tragedy in this post is that sort also has a -u
switch, meaning this could have been simply:
sort -u file >newfile
Oh well.
Just another Useless Use of Usenet,
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me