Created
July 9, 2016 23:09
-
-
Save pestilence669/98ee576a98561486bd719d630c9b0d77 to your computer and use it in GitHub Desktop.
Scala shell script template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exec scala "$0" "$@" | |
!# | |
// vim: set ts=2 sw=2 noet: | |
// http://alvinalexander.com/scala/how-to-handle-stdout-stderr-external-system-commands-scala | |
import sys.process._ | |
val stdout = new StringBuilder | |
val stderr = new StringBuilder | |
val status = "ls -la" ! ProcessLogger(stdout append _, stderr append _) | |
println(status) | |
println("stdout: " + stdout) | |
println("stderr: " + stderr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment