Chris Staub wrote:
> On 11/19/2009 08:30 PM, Bruce Dubbs wrote:
>> find dest/include -name .install -or -name ..install.cmd -exec rm
>> -v '{}' \;
> 
> Not quite - the -exec only works on the last option before it...or 
> something, I'm not quite sure exactly how to describe it technically,
> but in this case it would only operate on the files for the last
> -name option, or just the "..install.cmd" files. If you use -exec
> you'd need to put it after *each* -name, like this...
> 
> find dest/include -name .install -exec rm -v '{}' \; -or -name 
> ..install.cmd -exec rm -v '{}' \;
> 
> So in this case I found it easier just to pipe it through xargs.

find dest/include \( -name .install -o -name ..install.cmd \) -exec rm
-v '{}' \;

will work then.  Also, we could get rid of the escaping if we use + to
terminate the -exec command -- that's a GNU extension, but since we've
already installed findutils, it should at least work.

(Using + gives both the advantages of xargs and the advantages of old
style -exec: only one child process most of the time, as long as all
files will fit in argv, and the minimum number of child processes
otherwise, plus it doesn't choke on filenames with newlines or spaces in
their names.  It's just not standardized.  :-( )

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to