22

In Jenkins pipeline, what's the difference between:

sh """
...
...
... 
"""

and

sh '''
...
...
... 
'''

Thanks in advance

Itai Ganot
  • 5,873
  • 18
  • 56
  • 99

1 Answers1

27

Both are multi-line strings

The first multi-line string with """ can be templated into a GroovyString

The second one with ''' cannot (and is just a java String with newlines)

I have linked to the relevant documentation

tim_yates
  • 167,322
  • 27
  • 342
  • 338
  • 8
    Yes, triple double quoted strings support variable interpolation/substitution when triple simple quoted strings don't. – Pom12 Sep 05 '16 at 16:26