[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: find acting weird
From: |
Юрий Пухальский |
Subject: |
Re: find acting weird |
Date: |
Wed, 26 May 2010 19:58:30 +0400 |
2010/5/26 Dmitry V. Levin <address@hidden>:
> Hi,
>
> On Wed, May 26, 2010 at 01:42:53PM +0400, Юрий Пухальский wrote:
>>
>> I'm trying to remove the directories with find -exec and i've
>> encountered that for some reason the behaviour is strange. I've tested
>> with 4.1.20, 4.2.27 and 4.4.2.
>> I'm doing the following:
>>
>> devfe:~>mkdir -p findtest/a/b
>> devfe:~>cd findtest/
>> devfe:~/findtest>find . -name a -exec rm -rf {} \;
>> find: ./a: No such file or directory
>> devfe:~/findtest>ls
>
> find(1) is not aware of potential side effects of -exec command.
> You can instruct it not to enter processed directories by adding -prune,
> e. g. find . -name a -exec rm -rf {} \; -prune
Yes, for me it'll be perfect. But the question of small vagueness in
standard remains.
>
> BTW, the find manual recommends to avoid -exec due to security risks;
> -execdir is more secure, and -delete is the most secure and efficient.
:) Well, i'm using the standard to be portable...
>
>
> --
> ldv
>
--
«The good thing about standards is there are so many to choose from.»