I'm trying to do late binding of the directories where my packages are in a make command. Basically, WITH\_OPTIONS command line contains a space-separated list of link options similar to a configure script. The problem is the directories are bound late, after the command line to this script is parsed, so I need to eval the template string to get the right variable bindings. The closest I can come with so much googling and reading of the Bash FAQ, especially article 50 is something like:

```
MAKE_INSTALL="make install"
TEMPLATE=('--first=$a' '--second=$b' '--third=$a')

# Parse Parameters
a=/first/path
b=/second/path
TEMPLATE_REPL=$( eval echo ${TEMPLATE[@]} )
CMD="$MAKE_INSTALL WITH_OPTIONS=\"$TEMPLATE_REPL\""
$CMD

```

What I'd expect $CMD to contain would be a string with one command and 2 parameters:

```
make install WITH_OPTIONS="--first=/first/path --second=/second/path --third=/first/path"

```

However, I can't get bash to keep the part in quotes together, so it keeps parsing it as:

```
make install 'WITH_OPTIONS="--first=/first/path' '--second=/second/path' '--third=/first/path"'

```

Which is obviously totally wrong and will cause a bad command line when executed.

What am I missing? How do I preserve the bit between the quotes as one parameter, not 3?