I have this bash file:
#/bin/bash
PROP=\"-Dprop=foo bar\"
java $PROP -jar Foo.jar
So, what I want to do here is pass a space-separated li
Try PROP=-Dprop="foo bar" Or you could do
PROP="-Dprop=\"foo bar\""
You need to add the quotation marks around the shell script $ variable:
PROP="-Dprop=foo bar"
java "$PROP" -jar Foo.jar
Set the property as follows if there are spaces in the property value with multiple values;
PROP="-Dprop=foobar"
PROP="$PROP -DpropTwo='hello world'"
java "$PROP" -jar Foo.jar