I am doing a simple job of passing my java arguments from shell to java and one of the arguments happen to have spaces.
./test.ksh -test param1 param2 "\"param3 with spaces\""
code in test.ksh
if [ "$1" = "-test" ]
then
echo "Test"
SCRIPT_ARG="${*}"
echo "${SCRIPT_ARG}"
fi
java -jar test.jar ${SCRIPT_ARG}
But inside the java code the third parameter is being read and printed as
"param3
it seems very simple, but short of ideas here