• Bug
  • Status: Closed
  • 2 Major
  • Resolution: Fixed
  • X-Common Code
  • hhuynh
  • Reporter: peter
  • October 10, 2008
  • 0
  • Watchers: 0
  • November 07, 2008
  • November 06, 2008

Description

On Ubuntu, /bin/sh is linked to ‘dash’

dso-java.sh fails to run under dash, complaining about: dso-java.sh: 14: Syntax error: “(“ unexpected

the line in question is: ARGS=($*)

making the script explicitly depend upon bash fixes the problem.

Comments

Hung Huynh 2008-10-10

This issue has popped up more often now and the the fix is real simple. Just explicitly set all our scripts to use /bin/bash instead of /bin/sh. That will work in all platforms, even Solaris.

Taylor Gautier 2008-10-10

I still haven’t gotten a *solid* answer to this question:

do our scripts work with a real /bin/sh interpreter, or are they “sh incompatible” or are they only “dash incompatible” (we’ve already established that they are “bash compatible”)

Hung Huynh 2008-10-10

I believe they’re sh incompatible and dash incompatible.

Chris Dennis 2008-10-21

Obvious bashisms have been removed from the two offending scripts (dso-java.sh and start-tc-server.sh) with the help of the Debian checkbashisms tool. If more are discovered they should be easy and quick to fix.

Fiona OShea 2008-10-24

Can we merge this to 2.7 branch as well?

Hung Huynh 2008-10-31

scripts updated

Hung Huynh 2008-11-05

dso-java.sh failed in Solaris

bin/dso-java.sh: syntax error at line 14: `ARGS=’ unexpected


To reproduce, download 2.7.1 kit and change this in run.sh under inventory demo:

exec $TC_INSTALL_DIR/bin/dso-java.sh $JAVA_OPTS -cp “${CWD}/classes” demo.inventory.Main $ARGS #exec “${JAVA_HOME}/bin/java” ${TC_JAVA_OPTS} ${JAVA_OPTS} \

-cp “${CWD}/classes” demo.inventory.Main $ARGS

Hung Huynh 2008-11-05

workaround: change /bin/sh in dso-java.sh to /bin/bash

Hung Huynh 2008-11-06

this was fixed in trunk but wasn’t merged into 2.7. I have merged the fix from trunk to 2.7, r10770