|
|
|
|
|
by mindcrime
2537 days ago
|
|
Try Groovy: $groovy -e ' println "ls -l /".execute().text'
Without the "run the example on the command line" baggage, it reduces to: println "ls -l".execute().text
assuming you just want to spit out the results. What's nice about this is that it's ultimately just syntactic sugar over the standard Java ProcessBuilder / Process mechanism, and it's relatively easy to support more advanced cases like defining your own input, output, and error streams for the underlying process, etc. |
|