bash - How to Pass Quotes "" in a shell argument to java with argument containing white spaces -
i trying execute following command
./launch.sh -version 212 -file "/root/desktop/local test/list.csv"
the launch.sh
assigns arguments variable my_variable
when value assigned quotes around file path removed , echo $my_variable
gives following result:
./launch.sh -version 212 -file /root/desktop/local test/list.csv
now launch.sh
calls java , gives my_variable
argument
but java splits argument file , try process /root/desktop/local
, end error while should taking /root/desktop/local test/list.csv
.
how can ignore white spaces in java argument or keep quotes while assigning value variable make sure give correct arguments.
you can try add 2 escaped quotes ( \" ) this:
"\"/root/desktop/local test/list.csv\""
Comments
Post a Comment