Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jan 2004 18:53:32 -0500
From:      parv <parv@pair.com>
To:        Charles Swiger <cswiger@mac.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: grepping distinct lines from many text files ?
Message-ID:  <20040121235332.GA392@moo.holy.cow>
In-Reply-To: <4090DBB9-4B7B-11D8-8D97-003065ABFD92@mac.com>
References:  <20040120205621.05fc84da@it.buh.cameradicommercio.ro> <4090DBB9-4B7B-11D8-8D97-003065ABFD92@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
in message <4090DBB9-4B7B-11D8-8D97-003065ABFD92@mac.com>,
wrote Charles Swiger thusly...
>
> On Jan 20, 2004, at 1:56 PM, Ion-Mihai Tetcu wrote:
> >
> >CUCU=`cat /path/do/dir/* | some_filer_program`
> >
> >and have in $CUCU the distinct lines from all the files.
> 
> Try:
> 
> CUCU=`cat /path/to/files/* | sort | uniq`

Better yet...

 CUCU=`sort /path/to/files/* | uniq`


...even (but do see sort(1))...


 CUCU=`sort -u /path/to/files/*`


  - Parv

-- 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040121235332.GA392>