Skip to content

Instantly share code, notes, and snippets.

@caarmen
Created July 2, 2024 12:59
Show Gist options
  • Save caarmen/9ff56171924e785a298017d8b7f1b89d to your computer and use it in GitHub Desktop.
Save caarmen/9ff56171924e785a298017d8b7f1b89d to your computer and use it in GitHub Desktop.
groovy script console
command="ls -la"
process=command.execute()
process.waitFor()
def output = process.in.text
println "Output:\n$output"
def error = process.err.text
println "Error:\n$error"
def exitCode = process.exitValue()
println "Exit Code: $exitCode"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment