From owner-freebsd-questions Tue Jan 15 23:39:18 2002 Delivered-To: freebsd-questions@freebsd.org Received: from Waltham.fkeinternet.com (ns1.FKEinternet.com [208.58.172.24]) by hub.freebsd.org (Postfix) with ESMTP id 9ED2137B41D for ; Tue, 15 Jan 2002 23:39:07 -0800 (PST) Received: from flighty.L5Development.com (h005018064501.ne.mediaone.net [24.218.222.21]) by Waltham.fkeinternet.com (8.12.1/8.12.1) with ESMTP id g0G7dOYV057148; Wed, 16 Jan 2002 02:39:24 -0500 (EST) Message-Id: <5.1.0.14.1.20020116021843.00a21320@L5Development.com> X-Sender: wfredk@L5Development.com X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Wed, 16 Jan 2002 02:39:04 -0500 To: freebsd-questions@FreeBSD.org From: Fred Koschara Subject: Why does find -exec not work? Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed 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 I want to print the contents of several log files my Web application has generated. I read the "find" man page, which looks to me as if there's supposed to be an easy way to do this: -exec utility [argument ...]; True if the program named utility returns a zero value as its exit status. Optional arguments may be passed to the utility. The expression must be terminated by a semicolon (``;''). If the string ``{}'' appears anywhere in the utility name or the argu- ments it is replaced by the pathname of the current file. Utility will be executed from the directory from which find was executed. Utility and arguments are not subject to the further expansion of shell patterns and constructs. My interpretation of the above section indicates I should be able to run cat for each one of the files that's found, which would produce the output I'm looking for. However, the second "find" call here doesn't work: ttyp0 # find . -name "*Played*" -print ./Artists/Acoustic/logs/1010572/200201_1010572_PlayedSample ./Artists/Acoustic/logs/1010572/200201_1010572_PlayedTrack ./Artists/Popular/logs/1010539/200201_1010539_PlayedTrack ./Artists/Popular/logs/1010539/200201_1010539_PlayedSample Wed Jan 16 02:09:42 EST 2002 ttyp0 # find . -name "*Played*" -print -exec cat {}; find: -exec: no terminating ";" Wed Jan 16 02:10:05 EST 2002 ttyp0 # uname -a FreeBSD Waltham.fkeinternet.com 4.4-RELEASE FreeBSD 4.4-RELEASE #0: Mon Nov 26 12:54:30 EST 2001 root@Waltham:/usr/src/sys/compile/WALTHAM i386 I've tried as many different variations of quotes, backslashes, double semicolons, etc. as I thought could be possible, but I can't seem to get anything but 'find: -exec: no terminating ";"' as a result. Isn't there a terminating ';' on the line I entered? Am I completely misreading something? ________________________________________________________________________ For private sector (commercial) space development, visit http://www.L5Development.com L5 Software Development - "out of this world" sites and software http://www.L5Software.com StudioLines.com - Your place on the Internet for local music Music, feedback, connections. Tap the power of the Internet! http://www.StudioLines.com How much did your last traffic ticket cost you? http://www.StopHighwayRobbery.com ThmIndxr(tm), the *only* HTML thumbnail/indexer you need! http://www.L5Software.com/go?ThmIndxr wCapLock(tm), makes CapsLock work like it does on a typewriter http://www.L5Software.com/go?wCapLock KeywordGo(tm), provides keyword access to your popular pages http://www.L5Software.com/go?KeywordGo BannerAds(tm), join multiple affiliate programs with one banner http://www.L5Software.com/go?BannerAds FredLines(tm), T-Shirts For the Thinking Mind(tm) You've seen them, now wear them! http://www.FredLines-TShirts.com My personal Web page is http://www.L5Development.com/wfredk Stop by some time! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message