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

Variable with consecutive dollar characters not displayed as expected: One doller char is dropped

      When trying to mask passwords with 2 or more dollar ($) characters together, the password is not masked
      e.g. pa$$word is not masked

      Also, the console log shows this with only one dollar character
      e.g. if you add a window batch command:

      echo %PASSWORD%

      with pa$$word as %PASSWORD% the console will show:

      D:\jenkins\workspace\hp_test_job>echo pa$word
      pa$word

      notice only one dollar in output ... is $ an escape character?

          [JENKINS-12502] Variable with consecutive dollar characters not displayed as expected: One doller char is dropped

          Romain Seguy added a comment -

          I confirm.
          I'm investigating.

          Romain Seguy added a comment - I confirm. I'm investigating.

          Romain Seguy added a comment -

          So, the issue doesn't come actually from the plugin but from Jenkins: If you use a plain Jenkins install with no plugin, define a build parameter whose value is pa$$word, and display it in a build step, the output will be pa$word. I'm checking why.

          Romain Seguy added a comment - So, the issue doesn't come actually from the plugin but from Jenkins: If you use a plain Jenkins install with no plugin, define a build parameter whose value is pa$$word, and display it in a build step, the output will be pa$word. I'm checking why.

          Hiren Patel added a comment - - edited

          ah right, I think you can use $ to reference another parameter
          e.g. if you have a parameter called PARAM1 defined as world
          and another parameter PARAM2 defined as hello$PARAM1
          PARAM2 will be expanded to helloworld
          However, I've not seen this documented, so don't know if it is an actual feature (and I don't know if it works everywhere). Plus I didn't expect to be able to reference environment variables like this on windows

          Hiren Patel added a comment - - edited ah right, I think you can use $ to reference another parameter e.g. if you have a parameter called PARAM1 defined as world and another parameter PARAM2 defined as hello$PARAM1 PARAM2 will be expanded to helloworld However, I've not seen this documented, so don't know if it is an actual feature (and I don't know if it works everywhere). Plus I didn't expect to be able to reference environment variables like this on windows

          Doug Stewart added a comment -

          I am experiencing the same issue. Is there any way around this?

          Doug Stewart added a comment - I am experiencing the same issue. Is there any way around this?

            danielpetisme Daniel Petisme
            hiren Hiren Patel
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: