groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keegan Witt (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-7545) Incorrect handling of quotes in executed strings
Date Thu, 20 Aug 2015 23:17:45 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-7545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14705952#comment-14705952
] 

Keegan Witt commented on GROOVY-7545:
-------------------------------------

I should add, if you can think of a way to make this work, I'd love to hear it.  Just keep
all the complexities in mind:
* Unmatched single quotes used as apostrophes
* Single quotes, double quotes, and/or spaces in binary names and/or arguments
* Nesting of single and double quotes to control args of binary (double or single might be
outermost)

> Incorrect handling of quotes in executed strings
> ------------------------------------------------
>
>                 Key: GROOVY-7545
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7545
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.0
>            Reporter: Pavel
>
> {code}
> cat execute.bug.groovy
> #!/bin/env groovy
> String cmd = "sh -c 'echo test' "
> println "cmd: $cmd"
> def proc = cmd.execute()
> proc.waitForProcessOutput(System.out, System.err)
> {code}
> {code}
> $ LANG=en_US.utf8 ./execute.bug.groovy
> cmd: sh -c 'echo test' 
> test': -c: line 0: unexpected EOF while looking for matching `''
> test': -c: line 1: syntax error: unexpected end of file
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message