tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Cole (JIRA)" <j...@apache.org>
Subject [jira] [Created] (OPENEJB-2065) Change 1482211 causes shell error if bin/openejb is given more than one argument
Date Sat, 04 Jan 2014 06:24:50 GMT
Bill Cole created OPENEJB-2065:
----------------------------------

             Summary: Change 1482211 causes shell error if bin/openejb is given more than
one argument
                 Key: OPENEJB-2065
                 URL: https://issues.apache.org/jira/browse/OPENEJB-2065
             Project: OpenEJB
          Issue Type: Bug
    Affects Versions: 4.6.0
         Environment: Any OS with a POSIX shell (sh, ksh, bash, etc) 
            Reporter: Bill Cole


$@ is always word-split, even inside doublequotes. Hence line:

if [ "x$@" = "xdebug" ]; then

throws a shell syntax error (in bash "too many arguments", in BSD sh "unexpected operator"
) if the script is given multiple arguments (such as those documented in README.txt) because
"x$@" is expanded to  x$1 $2 [...] $n NOT "x$1 $2 [...] $n"

The cleanest fix is to change line 83 to:

if [ "$1" = "debug" ]; then

This is a precise check for whether the first argument to the script is "debug" and clearly
that's the only relevant argument in such a case, as the "then" clause causes any other args
to be ignored. 






--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message