This does not work:
$ groovy -e 'println "Hello, world!"'
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
script_from_command_line: 1: unexpected char: 0xFFFF @ line 1, column 23.
println "Hello, world!
^
1 error
However, putting a space between the last double- and single-quote works...
$ # groovy -e 'println "Hello, world!"'
$ groovy -e 'println "Hello, world!" '
Hello, world!
... even though bash
seems to be able to correctly handle the trailing "'
pair (i.e., without any intervening space) as follows:
$ echo '"Hello, world!"'
"Hello, world!"
Also, parenthesizing the println
argument works just fine:
$ groovy -e 'println ("Hello, world!")'
Hello, world!
Now, I would like to know why the very first case does not work.
I'm using:
As BDKosher already stated, this is a bug from Apache Commons CLI. Groovy wants to update to 1.3, but the CLI folks take their time with that version and it contains incompatibilities.
And as I wrote in an above comment already 0xFFFF is used by antlr to show the end of the file, it does not have to be a valid unicode character for that. The wording was criticized because of this, but the wording is from the parser generator antlr, not from us.
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