Skip to content

Instantly share code, notes, and snippets.

@shogonir
Created November 1, 2016 14:56
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 shogonir/d2e3d2457acf61dd74bdee9c1acc2845 to your computer and use it in GitHub Desktop.
Save shogonir/d2e3d2457acf61dd74bdee9c1acc2845 to your computer and use it in GitHub Desktop.
Read environmental variable with Scala.
object SysEnv {
def main(args: Array[String]) {
sys.env.getOrElse("USER", "default") match {
case value: String =>
println(value)
case _ =>
println("not string")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment