Using Groovy and it\'s java.lang.Process support, how do I pipe multiple shell commands together?
java.lang.Process
Consider this bash command (and assume your username i
You can do this to just let the shell sort it out:
// slash string at the end so we don't need to escape ' or $ def p = ['/bin/bash', '-c', /ps aux | grep ' foo' | awk '{print $1}'/].execute() p.waitFor() println p.text