You need to run the script like this:
groovy helloworld.groovy
#!groovy
println("hello world!")
$ chmod +x script.groovy
$ ./script.groovy
You need to run the script like this:
groovy helloworld.groovy
#!groovy
println("hello world!")
$ chmod +x script.groovy
$ ./script.groovy