$$ collapsed to $ in Pipeline parameter values

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      When you enable "This project is parameterized" option and provide Password Parameter for example with name PASS and default value Pass$$ dollar sign get escaped by Jenkins to Pass$. 

       

      This is the pipeline script

       

      timeout(20) {
          
         node('agent-maven-python') {
      	stage('bash') {
      		sh '''
                      echo $PASS
                      echo ''' + PASS + '''
      	       '''
      	}
         }
      }
      

      This is the output, it is missing the second $ sign. I haven't found other escaped symbols . Jenkins version jenkins-2.138.4

      + echo 'Pass$'
      Pass$
      + echo 'Pass$'
      Pass$
      

       This also affects simple println

      timeout(20) {
          
      node() {
      	stage('Sample bash') {
      	    println env.PASS
      	}
      }
      }
      

            Assignee:
            Unassigned
            Reporter:
            Ventseslav Vatashki
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: