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

No line break in text file to add $BUILD_NUMBER

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • core
    • Jenkins Version 5.6.2, Cent OS, JDK 1.8, Firefox

      Hi everyone. 

      I just wanna add build number in a new line at the end of a simple text file (name: version.property) after build step.

      Using shell console plugin in any job on Jenkins UI:  

      echo $BUILD_NUMBER >> version.property

      Unfortunately, this way doesnt work.

      Adding "\n" or "\n\" to the command dont work. 

      my current solution is: 

      echo  >> version.property

      echo $BUILD_NUMBER>> version.property

       

      If I add the new line with " echo blabla >> version.property" to the file on the batch server itself (using shh on Jenkins), then it works. It seems it does matter what shall you use. 

            richscze nobody
            constantinkwiatkowski Constantin Kwiatkowski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: