I have a script which takes command line arguments and after some processing, it sends these arguments to the java application.
Some of these arguments can be quoted and I want to send those arguments as it is (in the quote). I am using following script:
$ARGS=""
for a in $@; do
ARGS = ${ARGS} ${a};
done
exec $JAR $ARGS
where $JAR contains command to run the jar.
But, if I run the script with following options:
script x y "a b"
The script treats the three parameters as x, y and a b.
And I want it to consider these parameters as: x, y and "a b".