Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-13542

Backslashes in Environment / Script-Variables are not quoted correctly for Groovy

    XMLWordPrintable

Details

    Description

      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

      Attachments

        Activity

          pschaefer_de Peter Schaefer created issue -
          gbois Gregory Boissinot made changes -
          Field Original Value New Value
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 144008 ] JNJira + In-Review [ 190856 ]

          People

            gbois Gregory Boissinot
            pschaefer_de Peter Schaefer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: