Skip to content

Running BEAST from command line fails when arguments contain spaces #1205

@jugne

Description

@jugne

On Mac and Linux (haven't checked Windows) the running from command line fails due to spaces in arguments. For example:

  1. beast "test 1.xml" (space in path)
  2. beast -D myRealArray="1.0 2.0 3.0 4.0" test.xml (gaps in array provided to RealParameter in the XML that takes $(myRealArray) as value)

I could not find a solution trying to escape the gaps, double quote, etc. Comma separated values are processed also don't work for RealParameter array init. The second example can of course be solved by having a json file and using -Df option instead.

Possible fix:

I think the issue is passing all arguments in single string, using $* at the end of

"$JAVA" -Dlauncher.wait.for.exit=true -Xss256m -Xmx8g -Djava.library.path="$LD_LIBRARY_PATH" -Duser.language=en -cp "$BEAST_LIB/launcher.jar" beast.pkgmgmt.launcher.BeastLauncher $*

This could be avoided using "$@" instead. For me it seems to work well, but not sure if there are any edge cases where this would not be a good idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions