Skip to content

Instantly share code, notes, and snippets.

@HouLinwei
Forked from dragade/simpleScript.scala
Created November 2, 2018 17:05
Show Gist options
  • Select an option

  • Save HouLinwei/a331342af117dc3d9d150f40bf701e2f to your computer and use it in GitHub Desktop.

Select an option

Save HouLinwei/a331342af117dc3d9d150f40bf701e2f to your computer and use it in GitHub Desktop.
example of a simple scala script
#!/bin/sh
#This is an example scala script which requires the user to have scala in the PATH
#you can set CP to contain whatever other jars you need
CP=.
exec scala -classpath $CP "$0" "$@"
!#
val x = 1 to 10
val sum = x.foldLeft(0)(_+_)
println("sum=" + sum);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment