Skip to content

Instantly share code, notes, and snippets.

@seralf
Last active December 15, 2015 22:09
Show Gist options
  • Save seralf/5331252 to your computer and use it in GitHub Desktop.
Save seralf/5331252 to your computer and use it in GitHub Desktop.
Recipes for scala scripting in shell/windows :-) from the official documentation: http://www.scala-lang.org/docu/files/tools/scala.html
::#!
@echo off
call scala -savecompiled %0 %*
goto :eof
::!#
/*
* this is a scala script for Windows!
*/
Console.println("Hello, world!")
argv.toList foreach Console.println
#!/bin/sh
exec scala -savecompiled "$0" "$@"
!#
/*
* this is a scala script for Unix!
*/
Console.println("Hello, world!")
argv.toList foreach Console.println
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment