【问题标题】:What's the difference between """ and ''' in terms of running a shell script within a Jenkins pipeline step?在 Jenkins 流水线步骤中运行 shell 脚本时,""" 和 ''' 有什么区别?
【发布时间】:2016-09-05 15:28:09
【问题描述】:

在 Jenkins 流水线中,有什么区别:

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

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

提前致谢

【问题讨论】:

    标签: groovy dsl jenkins-pipeline


    【解决方案1】:

    都是多行字符串

    第一个带有"""can be templated into a GroovyString的多行字符串

    带有''' 的第二个不能(and is just a java String with newlines

    我已链接到相关文档

    【讨论】:

    • 是的,三重双引号字符串支持变量插值/替换,而三重简单引号字符串不支持。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-01-28
    • 2011-02-15
    • 1970-01-01
    • 2015-11-07
    • 2010-12-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多