From owner-freebsd-questions Mon Apr 8 14:19: 8 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 9CA8337B419 for ; Mon, 8 Apr 2002 14:19:04 -0700 (PDT) Received: from hades.hell.gr (patr530-a033.otenet.gr [212.205.215.33]) by mailsrv.otenet.gr (8.12.2/8.12.2) with ESMTP id g38LJ0rN003387; Tue, 9 Apr 2002 00:19:01 +0300 (EEST) Received: from hades.hell.gr (hades [127.0.0.1]) by hades.hell.gr (8.12.2/8.12.2) with ESMTP id g38LJ0GI025545; Tue, 9 Apr 2002 00:19:00 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from charon@localhost) by hades.hell.gr (8.12.2/8.12.2/Submit) id g38LIxLM025544; Tue, 9 Apr 2002 00:18:59 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Tue, 9 Apr 2002 00:18:58 +0300 From: Giorgos Keramidas To: Brendan McAlpine Cc: questions@FreeBSD.org Subject: Re: Scripting question... Message-ID: <20020408211858.GA25469@hades.hell.gr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.3.28i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2002-04-08 14:09, Brendan McAlpine wrote: > Can someone point me in the right direction here....? > > I have a set of directories that contain radius log files from the last > month. Each log file is named the same thing but the directories they > reside in are date stamped. I want to write a script that searches the > directories, finds files named ³detail², and cats the detail files into one > large combined file. I know this should be simple, but I am drawing > blanks.... $ cd /var/log/radius $ cat */detail > /tmp/foo For deeper nestings, you can probably get away with */*/detail, but it's safer to use find/xargs: $ ( find . -name detail -type f | xargs cat ) > /tmp/foo Giorgos Keramidas FreeBSD Documentation Project keramida@{freebsd.org,ceid.upatras.gr} http://www.FreeBSD.org/docproj/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message