grepping distinct lines from many text files ?

parv parv at pair.com
Wed Jan 21 16:35:32 PST 2004


in message <4090DBB9-4B7B-11D8-8D97-003065ABFD92 at 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

-- 



More information about the freebsd-questions mailing list