使用卷曲时髦脚本中的转义和字符



我在groovy脚本中使用bash执行curl:

descr = """
curl --silent -k -u test:test "https://bitbucket/rest/api/1.0/projects/test/repos/test/pull-requests?state=all&at=refs/heads/release/test" | /usr/bin/core_perl/json_pp
"""
def descrtxt = ['bash', '-c', descr].execute()
descrtxt.waitFor()

问题是curl忽略了&请求符号。而不是只给我要求与测试refs,给我所有的pr。我试着用'&'和&但没有运气

在bash命令中使用''',在curl命令中使用double

descr = '''
curl --silent -k -u test:test "https://bitbucket/rest/api/1.0/projects/test/repos/test/pull-requests?state=all&at=refs/heads/release/test" | /usr/bin/core_perl/json_pp
'''
def descrtxt = ['bash', '-c', descr].execute()
descrtxt.waitFor()

最新更新