JRuby

jruby bash script fails with bash 2.03 (Solaris 8)

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: JRuby 1.1RC2
  • Component/s: Interpreter
  • Labels:
    None
  • Environment:
    bash 2.03
    tested in Solaris 8
  • Patch Submitted:
    Yes
  • Number of attachments :
    1

Description

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=()

Activity

Hide
Yannick "Pouype" Francois added a comment -

I think It's same problem with jruby-1967. Those bugs must be join (I think)

Show
Yannick "Pouype" Francois added a comment - I think It's same problem with jruby-1967. Those bugs must be join (I think)
Hide
Yannick "Pouype" Francois added a comment -

I would say: This bug is duplicate with jruby-1967, sorry. (http://jira.codehaus.org/browse/JRUBY-1967)

Show
Yannick "Pouype" Francois added a comment - I would say: This bug is duplicate with jruby-1967, sorry. (http://jira.codehaus.org/browse/JRUBY-1967)
Hide
Charles Oliver Nutter added a comment -

Fix in 1.1? We need help here.

Show
Charles Oliver Nutter added a comment - Fix in 1.1? We need help here.
Hide
Javier Vidal Postigo added a comment -

I've tested it in 1.1 RC1. Not fixed.

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

Show
Javier Vidal Postigo added a comment - I've tested it in 1.1 RC1. Not fixed. I've attached a patch so jruby bash script works with bash < 2.03.
Hide
Javier Vidal Postigo added a comment -

I've tested it in trunk, revision 5627. Not fixed.

Show
Javier Vidal Postigo added a comment - I've tested it in trunk, revision 5627. Not fixed.
Hide
Charles Oliver Nutter added a comment -

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!

Show
Charles Oliver Nutter added a comment - 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!

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: