Suppose I have a Groovy script in Jenkins that contains a multi-line shell script. How can I set and use a variable within that script? The normal way produces an error:
I'm just putting a '\' on the end of line
sh script: """\ foo='bar' \ echo $foo \ """, returnStdout: true
This statement works on my script.