I like to execute the command and copy its stdout and stderr to the log file.
I like to run:
p = myexecute("ls -l /tmp/")
And essentially, the same process object returns as:
p = "ls -l /tmp/".execute()
The difference is that stdout / stderr is copied to the specified log file. I'm sure there is an easy way to do this in groovy, but I'm not groovy enough to see it.
source
share