bash -c会成功的 只要记住第一个参数是$ 0而不是$ 1
例如:
我的剧本-
echo hello $0!
在Jenkinsfile中
def script = libraryResource 'hello.sh' sh "bash -c '$script' world"
结果就是世界!

bash -c会成功的 只要记住第一个参数是$ 0而不是$ 1
例如:
我的剧本-
echo hello $0!
在Jenkinsfile中
def script = libraryResource 'hello.sh' sh "bash -c '$script' world"
结果就是世界!