From owner-freebsd-questions@FreeBSD.ORG Wed Jan 21 16:35:31 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E8EFD16A4CE for ; Wed, 21 Jan 2004 16:35:31 -0800 (PST) Received: from mta4.adelphia.net (mta4.adelphia.net [68.168.78.184]) by mx1.FreeBSD.org (Postfix) with ESMTP id C9EAA43D1D for ; Wed, 21 Jan 2004 16:35:30 -0800 (PST) (envelope-from parv_fm@mailsent.net) Received: from moo.holy.cow ([69.160.71.102]) by mta13.adelphia.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040121235343.PGST8989.mta13.adelphia.net@moo.holy.cow>; Wed, 21 Jan 2004 18:53:43 -0500 Received: by moo.holy.cow (Postfix, from userid 1001) id D5F71A203; Wed, 21 Jan 2004 18:53:32 -0500 (EST) Date: Wed, 21 Jan 2004 18:53:32 -0500 From: parv To: Charles Swiger Message-ID: <20040121235332.GA392@moo.holy.cow> Mail-Followup-To: Charles Swiger , Ion-Mihai Tetcu , freebsd-questions@freebsd.org References: <20040120205621.05fc84da@it.buh.cameradicommercio.ro> <4090DBB9-4B7B-11D8-8D97-003065ABFD92@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4090DBB9-4B7B-11D8-8D97-003065ABFD92@mac.com> cc: Ion-Mihai Tetcu cc: freebsd-questions@freebsd.org Subject: Re: grepping distinct lines from many text files ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2004 00:35:32 -0000 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 --