in reply to a way to do 'sort|uniq'

cat file.txt|sort|uniq
Deleting the useless use of cat, and using a far-underused sort flag, I'd type that as:
sort -u file.txt

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^2: a way to do 'sort|uniq'
by ikegami (Patriarch) on Aug 02, 2005 at 15:48 UTC
    That search doesn't result in anything particularly useful. The first match, the one which looks the most promising and the one which refers to you by name, is a broken link. A cached version is readable. It would be nice if you provided a link to your document instead of having us wade through broken links trying to figure out what you mean.
Re^2: a way to do 'sort|uniq'
by tlm (Prior) on Aug 03, 2005 at 03:48 UTC

    ...the useless use of cat...

    What do we have here?! It sure looks like a useless use of "use of"1. What's wrong with "the useless cat"? :-)

    1Or, if I'm to practice what I preach, a useless "use of".

    the lowliest monk

        Ah! Something like "PNS Syndrome"!

        Thanks for the cluebrick!

        the lowliest monk

Re^2: a way to do 'sort|uniq'
by jch341277 (Sexton) on Aug 02, 2005 at 16:30 UTC

    I was generalizing the construct - I usually do something like:

    $ tail +2 file.txt|tr -dc '[0-9\n]'|sort|uniq -c|sort -rnk 1

    I realize that the 'cat' would be useless in the simplified example that I gave, but the point was I wanted a way to do that same type of thing all in one step with perl.