Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.6
-
None
-
None
-
all *NIX/POSIX
-
Patch
Description
A lot of people like to create symlinks to executable binaries or scripts. For example, many linux systems use the alternatives system to symlink
/usr/bin/progname -> /etc/alternatives/progname -> /path/to/progname
Currently, groovy does not support this option. If I have:
$ ls -l /home/greg/bin/groovy
lrwxrwxrwx 1 greg greg 40 2009-02-22 22:49 /home/greg/bin/groovy -> /home/greg/opt/groovy/current/bin/groovy
And I try to run:
$ groovy -e 'print("HELLO GROOVY")'
-
-
- I get:
.: 28: Can't open /home/greg/bin/startGroovy
- I get:
-
A simple fix would be (adapted from the jruby startup script):
------------------------------
1c1
< #!/bin/sh
—
> #!/bin/ksh
15a16,29
> get_dirname()
>
>
17c31
< DIRNAME=`dirname "$0"`
—
> DIRNAME=`get_dirname $0`
--------------------
The above was tested in bash, dash and pdksh.
Ideally, the same patch would be applied to groovyc and groovysh as well