From owner-freebsd-questions@FreeBSD.ORG Tue Jan 20 10:54:58 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 2757F16A4CE for ; Tue, 20 Jan 2004 10:54:58 -0800 (PST) Received: from rdsnet.ro (smtp.rdsnet.ro [62.231.74.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5FCEE43D1D for ; Tue, 20 Jan 2004 10:54:56 -0800 (PST) (envelope-from itetcu@apropo.ro) Received: (qmail 15891 invoked from network); 20 Jan 2004 18:54:55 -0000 Received: from unknown (HELO it.buh.cameradicommercio.ro) (81.196.25.19) by mail.rdsnet.ro with SMTP; 20 Jan 2004 18:54:54 -0000 Date: Tue, 20 Jan 2004 20:56:21 +0200 From: Ion-Mihai Tetcu To: freebsd-questions@freebsd.org Message-Id: <20040120205621.05fc84da@it.buh.cameradicommercio.ro> X-Mailer: Sylpheed version 0.9.8claws (GTK+ 1.2.10; i386-portbld-freebsd5.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: 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: Tue, 20 Jan 2004 18:54:58 -0000 Hi, I know I have done this before, but I don't remember how ;) I have a collection of text files in one directory, and each file can contain one or more lines of text, of which any of them could also be in another file and what I want is to do something like: CUCU=`cat /path/do/dir/* | some_filer_program` and have in $CUCU the distinct lines from all the files. Something like SQL's SELECT DISTINCT FROM .... Any pointers ? Tnx, -- IOnut Unregistered ;) FreeBSD user