Skip to content

Instantly share code, notes, and snippets.

@mesagie
Created March 31, 2013 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mesagie/5280062 to your computer and use it in GitHub Desktop.
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
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