Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
1.5.1
-
None
-
None
-
ubuntu linux, sun-java-6; also duplicated on windows/cygwin java1.5
Description
The following 2-line script will run if called with an absolute path, but fails if called as ../bin/scriptName
Here's the script:
#!/usr/bin/env groovy
println("Yo!");
This may be an example of GROOVY-569, since renaming the script to have a .gr suffix seems to solve the problem.
I wasn't aware until reading GROOVY-569 that script names must have a dot!
This is very confusing: script names actually don't require a dot except in limited circumstances.
I've been using groovy for a year or so, and this is the first I've encountered this requirement. The "Groovy in Action"
book doesn't seem to mention this requirement, although all their examples seem to use .groovy suffix, so maybe it's in there somewhere.
I'm a keyboard junkie (100+ words per minute) and would like to be able to create short concise names for all my scripts, not
just bash / perl / etc. Scripting languages (at least in unix land).
For the sake of script developers coming from other languages, it would be preferable to strictly enforce this naming requirement in every case (e.g., "illegal script name: filename suffix is mandatory"), since it's very difficult to track down the cause of this problem. A frustrated developer is not likely to be searching for the phrase "script name" if the symptoms are relative to absolute versus relative path used with calling a script.
BTW, groovy rocks!
Attachments
Issue Links
- duplicates
-
GROOVY-569 java.lang.ClassFormatError running groovy script from shell (bash)
- Closed