Skip to content

Instantly share code, notes, and snippets.

@zaxebo1
Forked from tyrcho/README.md
Created September 10, 2018 06:09
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 zaxebo1/592554d3fd5febc3ec4abe07694da6ac to your computer and use it in GitHub Desktop.
Save zaxebo1/592554d3fd5febc3ec4abe07694da6ac to your computer and use it in GitHub Desktop.
Scala from (Windows) command line

A sample batch file running a scala script with process to call external commands.

The same can be done for *nix systems.

::#!
@echo off
call scala -savecompiled %0 %*
goto :eof
::!#
Console.println("Hello, world!")
argv.toList foreach Console.println
import scala.sys.process._
import java.io.File
println ("ls" #| "wc -l" !)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment