Re: How test for directory with single quote (') in the name (with find)?

2015-03-04 Thread Bernhard Voelker
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 >> n

Re: How test for directory with single quote (') in the name (with find)?

2015-03-04 Thread Morgan Weetman
- Original Message - > From: "Bernhard Voelker" > To: "Morgan Weetman" , "Peng Yu" > Cc: bug-findutils@gnu.org > Sent: Thursday, 5 March, 2015 9:39:52 AM > Subject: Re: How test for directory with single quote (') in the name (with > find)? > > On 03/04/2015 11:17 PM, Morgan Weetman

Re: How test for directory with single quote (') in the name (with find)?

2015-03-04 Thread Bernhard Voelker
On 03/04/2015 11:17 PM, Morgan Weetman wrote: > The example below has assumed that you wanted to test that .export was a file: > > find . -type d -exec sh -c "test -f \"{}\"/.export" \; -print > > .. works for me on 4.5.11 Well, the problem is when now a directory has a double quote '"' in its n

Re: How test for directory with single quote (') in the name (with find)?

2015-03-04 Thread Morgan Weetman
- Original Message - > From: "Peng Yu" > To: bug-findutils@gnu.org > Sent: Thursday, 5 March, 2015 2:16:55 AM > Subject: How test for directory with single quote (') in the name (with find)? > > Hi, > > The following code shows that if a directory has single quote in the > name, it does

How test for directory with single quote (') in the name (with find)?

2015-03-04 Thread Peng Yu
Hi, The following code shows that if a directory has single quote in the name, it does not work. Does anybody know what the correct way is to use -exec to test when there is single quote in the command? Thanks. /tmp/tryfind$ find . -type f ./'/.export /tmp/tryfind$ find . -type d -exec sh -c "tes