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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to