Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 74F2B200BC6 for ; Sun, 20 Nov 2016 12:56:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 73717160B07; Sun, 20 Nov 2016 11:56:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BDDF2160AF1 for ; Sun, 20 Nov 2016 12:56:05 +0100 (CET) Received: (qmail 22512 invoked by uid 500); 20 Nov 2016 11:56:04 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 22497 invoked by uid 99); 20 Nov 2016 11:56:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Nov 2016 11:56:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6BDB2E1772; Sun, 20 Nov 2016 11:56:04 +0000 (UTC) From: PascalSchumacher To: issues@commons.apache.org Reply-To: issues@commons.apache.org References: In-Reply-To: Subject: [GitHub] commons-lang pull request #208: LANG-1066: Add shell/XSI escape/unescape sup... Content-Type: text/plain Message-Id: <20161120115604.6BDB2E1772@git1-us-west.apache.org> Date: Sun, 20 Nov 2016 11:56:04 +0000 (UTC) archived-at: Sun, 20 Nov 2016 11:56:06 -0000 Github user PascalSchumacher commented on a diff in the pull request: https://github.com/apache/commons-lang/pull/208#discussion_r88799453 --- Diff: src/main/java/org/apache/commons/lang3/StringEscapeUtils.java --- @@ -272,6 +272,40 @@ public int translate(final CharSequence input, final int index, final Writer out } } + /** + * Translator object for escaping Shell command language. + * + * @see Shell Command Language + */ + public static final CharSequenceTranslator ESCAPE_XSI = + new LookupTranslator( + new String[][] { + {"|", "\\|"}, + {"&", "\\&"}, + {";", "\\;"}, + {"<", "\\<"}, + {">", "\\>"}, + {"(", "\\("}, + {")", "\\)"}, + {"$", "\\$"}, + {"`", "\\`"}, + {"\\", "\\\\"}, + {"\"", "\\\""}, + {"'", "\\'"}, + {" ", "\\ "}, + {"\t", "\\\t"}, + {"\r\n", ""}, + {"\n", ""}, + {"*", "\\*"}, + {"?", "\\?"}, + {"[", "\\["}, --- End diff -- according to http://pubs.opengroup.org/onlinepubs/7908799/xcu/chap2.html it does not have to be escaped --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---