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

Cannot escape dollar sign in Windows environment

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • envinject-plugin
    • None
    • EnvInject 1.71

      Fix JENKINS-13566 introduced the following bug.

      I can no longer escape the dollar sign value on a Windows environment.

      e.g.
      foobar1=foo\$bar
      foobar2=foo$bar

      Respectively becomes:
      foo\$bar
      foo

      The value "foo$bar" cannot be achieved.

      My opinion is that the "escaping" behaviour should be the same regardless of operating system. I propose that the JENKINS-13566 changes should be reverted, and that Vincent Latombe should double escape their path.
      i.e.
      C:\DOCUME~1\\$NCESE~1\LOCALS~1\Temp

          [JENKINS-15751] Cannot escape dollar sign in Windows environment

          Nick Grealy created issue -
          Nick Grealy made changes -
          Description Original: Fix JENKINS-13566 introduced the following bug.

          I can no longer escape the dollar sign value on a Windows environment.

          e.g.
          foobar1=foo\$bar
          foobar2=foo$bar

          Respectively becomes:
          foo\$bar
          foo

          The value "foo$bar" cannot be achieved.

          My opinion is that the "escaping" behaviour should be the same regardless of operating system. I propose that the JENKINS-13566 changes should be reverted, and that Vincent Latombe should double escape his path.
          i.e.
          C:\DOCUME~1*\*\$NCESE~1\LOCALS~1\Temp
          New: Fix JENKINS-13566 introduced the following bug.

          I can no longer escape the dollar sign value on a Windows environment.

          e.g.
          foobar1=foo\$bar
          foobar2=foo$bar

          Respectively becomes:
          foo\$bar
          foo

          The value "foo$bar" cannot be achieved.

          My opinion is that the "escaping" behaviour should be the same regardless of operating system. I propose that the JENKINS-13566 changes should be reverted, and that Vincent Latombe should double escape his path.
          i.e.
          C:\DOCUME~1\\$NCESE~1\LOCALS~1\Temp
          Nick Grealy made changes -
          Link New: This issue is related to JENKINS-13566 [ JENKINS-13566 ]
          Nick Grealy made changes -
          Link New: This issue is duplicated by JENKINS-13157 [ JENKINS-13157 ]
          Nick Grealy made changes -
          Description Original: Fix JENKINS-13566 introduced the following bug.

          I can no longer escape the dollar sign value on a Windows environment.

          e.g.
          foobar1=foo\$bar
          foobar2=foo$bar

          Respectively becomes:
          foo\$bar
          foo

          The value "foo$bar" cannot be achieved.

          My opinion is that the "escaping" behaviour should be the same regardless of operating system. I propose that the JENKINS-13566 changes should be reverted, and that Vincent Latombe should double escape his path.
          i.e.
          C:\DOCUME~1\\$NCESE~1\LOCALS~1\Temp
          New: Fix JENKINS-13566 introduced the following bug.

          I can no longer escape the dollar sign value on a Windows environment.

          e.g.
          foobar1=foo\$bar
          foobar2=foo$bar

          Respectively becomes:
          foo\$bar
          foo

          The value "foo$bar" cannot be achieved.

          My opinion is that the "escaping" behaviour should be the same regardless of operating system. I propose that the JENKINS-13566 changes should be reverted, and that Vincent Latombe should double escape their path.
          i.e.
          C:\DOCUME~1\\$NCESE~1\LOCALS~1\Temp
          Gregory Boissinot made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          I added a comment in the previous issue.
          I asked Vincent what is his opinion?
          However, do you have a specific use case when you need to escape dollars?

          Gregory Boissinot added a comment - I added a comment in the previous issue. I asked Vincent what is his opinion? However, do you have a specific use case when you need to escape dollars?

          Nick Grealy added a comment -

          Hi Gregory,

          Sorry for the late reply (I don't have access to a windows Jenkins instance at the moment), but I'll use a similar use case to Vincent's:

          — User Story —

          As a Jenkins user
          I want to use the environment variable name "win_sys_path" with a value "\\127.0.0.1\c$\WINDOWS"
          So that I can access a windows system folder from a remote computer.

          — User Scenarios —

          Global: Given a Jenkins Windows instance

          Given the environment variable "win_sys_path" with value "\\127.0.0.1\c$\WINDOWS"
          When I echo the variable "win_sys_path"
          Then the value should be "\\127.0.0.1\c"

          Given the environment variable "win_sys_path" with value "\\127.0.0.1\c\$\WINDOWS"
          When I echo the variable "win_sys_path"
          Then the value should be "\\127.0.0.1\c$\WINDOWS"

          Given the environment variable "win_sys_path" with value "\\127.0.0.1\c\\$\WINDOWS"
          When I echo the variable "win_sys_path"
          Then the value should be "\\127.0.0.1\c\$\WINDOWS"

          Hope that makes sense.

          Nick

          Nick Grealy added a comment - Hi Gregory, Sorry for the late reply (I don't have access to a windows Jenkins instance at the moment), but I'll use a similar use case to Vincent's: — User Story — As a Jenkins user I want to use the environment variable name "win_sys_path" with a value "\\127.0.0.1\c$\WINDOWS" So that I can access a windows system folder from a remote computer. — User Scenarios — Global: Given a Jenkins Windows instance Given the environment variable "win_sys_path" with value "\\127.0.0.1\c$\WINDOWS" When I echo the variable "win_sys_path" Then the value should be "\\127.0.0.1\c" Given the environment variable "win_sys_path" with value "\\127.0.0.1\c\$\WINDOWS" When I echo the variable "win_sys_path" Then the value should be "\\127.0.0.1\c$\WINDOWS" Given the environment variable "win_sys_path" with value "\\127.0.0.1\c\\$\WINDOWS" When I echo the variable "win_sys_path" Then the value should be "\\127.0.0.1\c\$\WINDOWS" Hope that makes sense. Nick

          Nick Grealy added a comment -

          Update: ignore the "Global: Given a Jenkins Windows instance", this same functionality should apply on ALL operating systems (but in this case, specifically on Windows).

          Nick Grealy added a comment - Update: ignore the "Global: Given a Jenkins Windows instance", this same functionality should apply on ALL operating systems (but in this case, specifically on Windows).
          Nick Grealy made changes -
          Assignee Original: Gregory Boissinot [ gbois ] New: Nick Grealy [ nickg ]

            nickg Nick Grealy
            nickg Nick Grealy
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: