jruby -x bug
------------
Key: JRUBY-5823
URL: http://jira.codehaus.org/browse/JRUBY-5823
Project: JRuby
Issue Type: Bug
Components: Miscellaneous
Affects Versions: JRuby 1.6
Reporter: Pete Fritchman
Priority: Minor
IIRC, the "spirit" of jruby -x is to be like perl -x, and be able to do
something like this:
#!/bin/sh
exec jruby --1.9 -x $0 "$@"
#!jruby
...
The "-x" parsing code calls findScript, which looks for the first line
containing starting with "#!" and >2 characters. Unfortunately, this finds the
#!/bin/sh line. The code should skip the first line (presumably a #! for
another interpreter that will exec jruby -x ...). I'm trying to do this so I
can have a command line script that's run with jruby 1.9 (and doesn't require
the user to set an environment variable or something; other suggestions
welcome).
This is basically how the perl interpreter deals with -x (it actually requires
the #! it finds has perl in it somewhere). For example:
0 petef-xps(~) % ./foo.pl a b c
a b c
0 petef-xps(~) % cat foo.pl
#!/bin/sh
exec perl -x $0 "$@"
#!perl
print join(" ", @ARGV), "\n";
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email