Skip to content

Instantly share code, notes, and snippets.

@ohac
Created September 18, 2008 13:45
Show Gist options
  • Save ohac/11430 to your computer and use it in GitHub Desktop.
Save ohac/11430 to your computer and use it in GitHub Desktop.
//import java.io.ByteArrayInputStream
import java.io.{BufferedReader,InputStreamReader}
object A {
def main(a: Array[String]) {
for (i <- 0 until 10) {
println("hello " + i)
}
val ls = Runtime.getRuntime.exec("ls -l")
var in = ls.getInputStream
// in = new ByteArrayInputStream("abc\n".getBytes())
val re = new BufferedReader(new InputStreamReader(in))
var s = null: String
while ({ s = re.readLine; s != null}) {
println(s)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment