This curl command works in the terminal but fails in groovy. I added the err and out out from another question to try and understand why it fails.
def initialSize = 4096
def out = new ByteArrayOutputStream(initialSize)
def err = new ByteArrayOutputStream(initialSize)
def process = "sh -c curl'https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts'".execute()
process.consumeProcessOutput(out, err)
process.waitFor()
println process.text
println err.toString()
println out.toString()
The output is "curl: try 'curl --help' or 'curl --manual' for more information"