Why is using eval necessary to pass quoted arguments

2018-01-12 13:10:40

I have the following example.


ARGUMENTS="-executors 1 -description \"The Host\" "

# call1

# error: parameter Host" is not allowed

java -jar swarm-client.jar $ARGUMENTS

# call2

# works fine with eval

eval java -jar swarm-client.jar $ARGUMENTS

In $ARGUEMENTS I have a quoted argument.

I do not understand, why grouping of argument by escaped quotes is working in call1.

I do not understand, why eval is necessary to resolve the quoting.

I think I do not understand the process / the order of command evaluation in shell. Who can explain?