Bruce Dubbs wrote:
> Bruce Dubbs wrote:
>> Chris Staub wrote:
>>> On 11/19/2009 08:30 PM, Bruce Dubbs wrote:
>>>> Chris Staub wrote:
>>>>> But there are the ".install" files in every subdir, not just in the
>>>>> "linux" dir. I use:
>>>>>
>>>>> find dest/include -name .install -or -name ..install.cmd | xargs rm -fv
>>>> Ahh.  I didn't realize they were in multiple directories.
>>>>
>>>>     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.
>> Really?  I did:
>>
>> /mnt/lfs/sources/linux-2.6.30.2$ find dest/include -name .install -or 
>> -name ..install.cmd -exec ls -l {} \;
> 
> Drat.  Never mind.  I see you are right.  However
> 
>    find dest/include -name .*install* -exec ls -l {} \;
> 
> does the right thing.  The asterisks and braces do not need to be quoted 
> in bash, but the safe way would be to write:
> 
>    find dest/include -name '.*install*' -exec ls -l '{}' \;

The asterisks need to be quoted if the pattern could possibly expand to
any files (in the current directory, since no / characters are present)
-- this is unlikely, but possible, so quoting them is still a good idea
I think.

The braces, I'm not sure on.  Probably safest to either use '{}' or \{},
I think.

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