Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jan 2002 02:39:04 -0500
From:      Fred Koschara <wfredk@L5Development.com>
To:        freebsd-questions@FreeBSD.org
Subject:   Why does find -exec not work?
Message-ID:  <5.1.0.14.1.20020116021843.00a21320@L5Development.com>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5.1.0.14.1.20020116021843.00a21320>