Is there any Scala built-in class for capturing an external process's output?
process, scala
Solution
scala> scala.tools.nsc.io.Process("ls -1 /tmp | wc").stdout foreach println
41 63 770
Or there's a repl command:
scala> :sh cat /etc/passwd | wc
stdout: List[String] = List( 65 185 3667)
Shipping any IO code with 2.8 was going to require overcoming more stop energy than I can beat, so I put it all in the compiler. Plenty of reasonably useful stuff in scala.tools.nsc.io.
Problem
Since Scala has so many cool stuff I was thinking it may have something that makes capturing a process's output easy. I know the Java way of doing that, but I thought about asking for another way.