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 list as a System Property. But this somehow does not work:
Caused by: java.lang.ClassNotFoundException: bar
So, it seems that Bash breaks -Dprop=foo bar
up into -Dprop=foo
, bar
. I tried everything from double quoting to escaping the space character but nothing seems to work.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…