Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 25ABC9B06 for ; Thu, 15 Mar 2012 21:07:04 +0000 (UTC) Received: (qmail 10086 invoked by uid 500); 15 Mar 2012 21:07:02 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 9972 invoked by uid 500); 15 Mar 2012 21:07:02 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 9952 invoked by uid 99); 15 Mar 2012 21:07:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2012 21:07:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2012 21:06:59 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id D3B0A225E0 for ; Thu, 15 Mar 2012 21:06:38 +0000 (UTC) Date: Thu, 15 Mar 2012 21:06:38 +0000 (UTC) From: "Tsz Wo (Nicholas), SZE (Commented) (JIRA)" To: common-issues@hadoop.apache.org Message-ID: <1251676852.21118.1331845598868.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1393984661.19796.1331832937383.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HADOOP-8173) FsShell needs to handle quoted metachars MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-8173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13230545#comment-13230545 ] Tsz Wo (Nicholas), SZE commented on HADOOP-8173: ------------------------------------------------ I tested it with the following: {code} public static void main(String[] args) throws IOException { File f = new File("a.txt"); final BufferedReader in = new BufferedReader(new FileReader(f)); for(String line; (line = in.readLine()) != null;) { testPattern(line); } } static String testPattern(String s) { System.out.print("replace " + s); s = s.replaceAll("\\\\(.)", "$1"); System.out.println(" to " + s); return s; } {code} and the result is {noformat} replace foo* to foo* replace foo\* to foo* replace foo\\* to foo\* replace foo\\\* to foo\* replace foo\ to foo\ replace foo\\ to foo\ replace foo\\\ to foo\\ replace foo\** to foo** replace foo*bar to foo*bar replace foo\*bar to foo*bar replace foo\\*bar to foo\*bar replace foo\\\*bar to foo\*bar replace foo\bar to foobar replace foo\\bar to foo\bar replace foo\\\bar to foo\bar replace foo\**bar to foo**bar replace foo*bar* to foo*bar* replace foo\*bar\* to foo*bar* replace foo\\*bar\\* to foo\*bar\* replace foo\\\*bar\\\* to foo\*bar\* replace foo\bar\ to foobar\ replace foo\\bar\\ to foo\bar\ replace foo\\\bar\\\ to foo\bar\\ replace foo\**bar\** to foo**bar** {noformat} Do you think that they are all expected? > FsShell needs to handle quoted metachars > ---------------------------------------- > > Key: HADOOP-8173 > URL: https://issues.apache.org/jira/browse/HADOOP-8173 > Project: Hadoop Common > Issue Type: Sub-task > Components: fs > Affects Versions: 0.24.0, 0.23.2 > Reporter: Daryn Sharp > Assignee: Daryn Sharp > Attachments: HADOOP-8173.patch > > > Commands that access paths with quoted metachars work correctly, however commands that create paths with quoted metachars leave the \ in the path. Ex. > {noformat} > fs -mkdir "foo\*bar" will create "foo\*bar" instead of "foo*bar". > {noformat} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira