[ https://issues.jenkins-ci.org/browse/JENKINS-13542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=161836#comment-161836 ]
Peter Schaefer commented on JENKINS-13542: ------------------------------------------ Great. Escaping issues even here in the Wiki-text! It was meant to be {noformat} String baz = "$WORKSPACE\\sandbox"; {noformat} and {noformat} String baz = "C:\Jenkins\foo\bar\\sandbox"; ^ illegal escape sequence {noformat} respectively. > Backslashes in Environment / Script-Variables are not quoted correctly for > Groovy > --------------------------------------------------------------------------------- > > Key: JENKINS-13542 > URL: https://issues.jenkins-ci.org/browse/JENKINS-13542 > Project: Jenkins > Issue Type: Bug > Components: scripttrigger > Affects Versions: current > Environment: Windows > Reporter: Peter Schaefer > Assignee: gbois > Priority: Minor > > Under windows, the variable "WORKSPACE" usually contains backward-shlashes > (i.e. "C:\Jenkins\foo\bar"). Trying to assign a string variable like > String baz = "$WORKSPACE\\sandbox"; > is not possible. After the variables are substitued Groovy complains about > illegal character, since the statement looks like this: > String baz = "C:\Jenkins\foo\bar\\sandbox"; > ^ illegal escape sequence -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira