Menu

#64 #1983774 - start script passes parameters incorrectly

scheduled_for_2.0.7
open
nobody
5
2012-07-18
2008-06-03
No

When you launch [ganttproject.sh "my file.gan"] on the command line the
bash variable $1 is "my file.gan" while the ganttproject.sh script runs,
but the java app tries to open "my" instead of "my files.gan".

This is due to a bug in the ganttproject.sh script:
$JAVA_COMMAND -Xmx256m -classpath $CLASSPATH:$LOCAL_CLASSPATH $BOOT_CLASS
$CONFIGURATION_FILE $* >$GP_HOME/ganttproject.log 2>&1

Passing parameters with the $* does not preserve the spaces and blanks and
one parameter becomes two or more if there was a space in it. If one wants
to preserve those blanks the "$@" formula needs to be used. So the correct
line is:
$JAVA_COMMAND -Xmx256m -classpath $CLASSPATH:$LOCAL_CLASSPATH $BOOT_CLASS
$CONFIGURATION_FILE "$@" >$GP_HOME/ganttproject.log 2>&1

Discussion

  • Karoly Molnar

    Karoly Molnar - 2008-06-03
     
  • Joanna Muras

    Joanna Muras - 2008-06-21

    Logged In: YES
    user_id=1919741
    Originator: NO

    Thanks! Applied in CVS.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.