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

Multiline shell script should take interpreter from first non-blank line

XMLWordPrintable

      When using a mutli-line quote, the interpreter must be on the first line, which doesn't look as nice.

      Works:

      sh """#!/bin/bash -xel
        set -o pipefail
        # Do stuff.
        """
      

      Want:

      sh """
        #!/bin/bash -xel
        set -o pipefail
        # Do stuff.
        """
      

      (The latter will be passed to the default shell and ignored as a comment since it is on the second line.)

            Unassigned Unassigned
            aarondmarasco_vsi Aaron D. Marasco
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: