ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwadamson <...@git.apache.org>
Subject [GitHub] ant issue #24: fix 60150 values containing backtick or $ character cause she...
Date Sat, 08 Oct 2016 15:04:25 GMT
Github user jwadamson commented on the issue:

    https://github.com/apache/ant/pull/24
  
    I see a couple options:
    1)  we can continue playing with sed, but probably should use `printf '%s' "$X"` instead
of echo to pipe the input to avoid issues with trailing newlines and echo interpretation.
    2) use several ${X/Y/Z} replacement patterns. (doing backslash first so as not to double-encode
that)
    
    I think #2 is probably simpler going forward. Do we know if this is posix and supported
across platforms?
    	esc_arg="${arg}"
    	esc_arg="${esc_arg/\\/\\\\}" # must be first since later patterns introduce backslash
chars
    	esc_arg="${esc_arg/\$/\\\$}"
    	esc_arg="${esc_arg/\"/\\\"}"
    	esc_arg="${esc_arg/\`/\\\`}"
            quoted_arg="\"$esc_arg\""



---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message