I have a sh command in jenkinsfile.
sh 'command1 command2'
How to write this in multiple lines?
sh '''
command1 \
command2
'''
or
sh '''
command1 &&
command2
'''
The solution is :
sh """
command1 \\
command2 \\
"""
That worked for me.
I think that you should mix both:
sh '''
command1 && \
command2
'''
&& allows another command
\ tells to shell to ignore the following character (the new line)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With