[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How test for directory with single quote (') in the name (with find)
From: |
Bernhard Voelker |
Subject: |
Re: How test for directory with single quote (') in the name (with find)? |
Date: |
Thu, 05 Mar 2015 00:31:54 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 03/05/2015 12:08 AM, Morgan Weetman wrote:
>> The best I could think of is to avoid the extra shell, and to directly
>> invoke /usr/bin/test instead:
>>
>> $ find . -type d -exec test -f '{}'/.export \; -print
>>
>> This will work for both, directory names with '"' and with '\'' in their
>> names.
> My first advice was going to be "don't have directory names with quotes in
> them" .. :)
If you have control over it, then yes ... but there should be
a logic which is much clearer:
$ find . -type f -name '.export' -print
;-)
Have a nice day,
Berny