Created
March 31, 2013 09:11
-
-
Save mesagie/5280062 to your computer and use it in GitHub Desktop.
It's possible to use the Scala REPL as an advanced shell extension.
Here's a simple example of finding the longest file name in a directory from Scala Repl
This file contains 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
scala> :sh ls /tmp | |
res39: scala.tools.nsc.interpreter.ProcessResult = `ls /tmp` (20 lines, exit 0) | |
scala> res39.lines.maxBy(_.size) | |
res40: String = homebrew-brew-doctor-4Nsy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment