[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How test for directory with single quote (') in the name (with find)?
From: |
Peng Yu |
Subject: |
How test for directory with single quote (') in the name (with find)? |
Date: |
Wed, 4 Mar 2015 09:16:55 -0600 |
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 "test -d '{}'/.export" ';' -print
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
--
Regards,
Peng