I've been using this, but it changes the mimetype to text/x-shellscript
, which makes editors like Emacs treat my code like Shell scripts.
#!/bin/sh
exec scala "$0" "$@"
!#
The bangshe (!#) might be the problem
I commented out the !# and the following works in my environment:
File: hello.sh
#!/usr/bin/env scala
val name = readLine("What is your name? ")
println("Hello " + name + "!")
Changed to executable permissions and then ran:
chmod a+x hello.scala
./hello.scala
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With