Issue Details (XML | Word | Printable)

Key: JRUBY-1671
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Charles Oliver Nutter
Reporter: Javier Vidal Postigo
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JRuby

jruby bash script fails with bash 2.03 (Solaris 8)

Created: 05/Dec/07 09:54 AM   Updated: 23/Apr/08 10:02 AM
Component/s: Interpreter
Affects Version/s: None
Fix Version/s: JRuby 1.1RC2

Time Tracking:
Not Specified

File Attachments: 1. Text File jruby_issue_1671.patch (0.1 kB)

Environment: bash 2.03
tested in Solaris 8

Patch Submitted: Yes


 Description  « Hide
jruby bash script fails with bash 2.03:

$ jruby -v
/export/home/cacti/jruby-1.1b1/bin/jruby: while: command not found
/export/home/cacti/jruby-1.1b1/bin/jruby: line 119: syntax error near unexpected token `do'
/export/home/cacti/jruby-1.1b1/bin/jruby: line 119: `do'

The problem are these two empty array declarations:

java_args=()
ruby_args=()

This seems to be a bash 2.03 bug, but I haven't found any information reporting it.

I have found a workaround to this issue. Empty arrays can be declared this way:

declare -a java_args
declare -a ruby_args

So now jruby script works fine in Solaris 8.

Note 1: bash-2.03 is the default bash shell in Solaris 8
Note 2: I don't know if this diff can be used as a patch:

$ diff jruby jruby.orig
116,117c116,117
< declare -a java_args
< declare -a ruby_args

> java_args=()
> ruby_args=()



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Yannick "Pouype" Francois added a comment - 15/Jan/08 05:28 PM
I think It's same problem with jruby-1967. Those bugs must be join (I think)

Yannick "Pouype" Francois added a comment - 15/Jan/08 05:30 PM
I would say: This bug is duplicate with jruby-1967, sorry. (http://jira.codehaus.org/browse/JRUBY-1967)

Charles Oliver Nutter added a comment - 15/Jan/08 06:05 PM
Fix in 1.1? We need help here.

Javier Vidal Postigo added a comment - 16/Jan/08 04:54 AM
I've tested it in 1.1 RC1. Not fixed.

I've attached a patch so jruby bash script works with bash < 2.03.


Javier Vidal Postigo added a comment - 16/Jan/08 05:03 AM
I've tested it in trunk, revision 5627. Not fixed.

Charles Oliver Nutter added a comment - 26/Jan/08 01:54 AM
The provided patch seems to work fine for me on OS X, so I applied it. Please confirm it's working ok for you. Thanks!