Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
def process = "ls -l".execute()
process.in.eachLine { line -> println line }

...

in Groovy 1.5.5 the eachLine method is not available on InputStream. Earlier or later version will have that method. As an alternative you can use process.in.newReader().eachLine { line -> println line }

Remember that many commands are shell built-ins and need special handling. So if you want a listing of files in a directory on a windows machine and if you write

...