You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by jwagenleitner <gi...@git.apache.org> on 2016/01/15 20:00:51 UTC

[GitHub] groovy pull request: GROOVY-7378: Support JAVA_OPTS containing quo...

Github user jwagenleitner commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/5#discussion_r49890958
  
    --- Diff: src/bin/startGroovy ---
    @@ -261,18 +261,18 @@ startGroovy ( ) {
         if $useprofiler ; then
             runProfiler
         else
    -        exec "$JAVACMD" $JAVA_OPTS \
    -            -classpath "$STARTER_CLASSPATH" \
    -            -Dscript.name="$SCRIPT_PATH" \
    -            -Dprogram.name="$PROGNAME" \
    -            -Dgroovy.starter.conf="$GROOVY_CONF" \
    -            -Dgroovy.home="$GROOVY_HOME" \
    -            -Dtools.jar="$TOOLS_JAR" \
    +        eval exec "\"\$JAVACMD\"" $JAVA_OPTS \
    +            -classpath "\"\$STARTER_CLASSPATH\"" \
    +            -Dscript.name="\"\$SCRIPT_PATH\"" \
    +            -Dprogram.name="\"\$PROGNAME\"" \
    +            -Dgroovy.starter.conf="\"\$GROOVY_CONF\"" \
    +            -Dgroovy.home="\"\$GROOVY_HOME\"" \
    +            -Dtools.jar="\"\$TOOLS_JAR\"" \
    --- End diff --
    
    Looks like there is an extra backslash before the environment variable that will cause it to not interpolate.  For example, think change should just be:
    
    `"\"$VAR\""` (no slash before `$`)
    
    For reference I checked [Tomcat's catalina.sh] (https://github.com/apache/tomcat/blob/86b1281a190ec2f17fd1ac5ae3d3889166dcd360/bin/catalina.sh#L325-L339) to see how they handled it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---