Running an external process from a GString


/ Published in: Groovy
Save to your folder(s)

An easy way to launch an external process (http://docs.codehaus.org/display/GroovyJSR/Run+Sub-Process+Safely).


Copy this code and paste it in your HTML
  1. proc = "ls -al".execute()
  2. println(proc.in.text)
  3. println(proc.returnCode())

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.