Skip to content

Instantly share code, notes, and snippets.

@ramn
Created April 10, 2015 15:14
Show Gist options
  • Save ramn/98301d6dac804d97b430 to your computer and use it in GitHub Desktop.
Save ramn/98301d6dac804d97b430 to your computer and use it in GitHub Desktop.
Scala as script (shebang header)
#!/bin/bash
CP="$(find $HOME/.ivy2 -path '*myorg/*util_2.11-*.jar' | tail -1)"
exec scala -savecompiled -cp "$CP" $0 $@
!#
import com.myorg.MyClass
io.Source.stdin
.getLines
.map { line =>
new MyClass(line)
}
.foreach(println)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment