We may also run our example as a shell script or batch command
The bash shell script script.sh containing the following Scala code (and shell preamble)
#!/bin/sh
exec scala "$0" "$@"
!#
object HelloWorld extends App {
println("Hello, world!")
}
HelloWorld.main(args)
The above code can be run directly from the command shell:
./script.sh