Environment: Ubuntu 18.04. I'm attempting to start an xfce4-terminal with multiple tabs. The number of tabs will change hence I have to build an string will all the argument passed to xfce4-terminal.
#!/bin/bash
xfce4Args="--disable-server --hold --minimize"
Acq="ls -R"
OPTIONS="-R"
Ser="--title=Pre --command=ls ${OPTIONS}"
xfce4-terminal ${xfce4Args} --title="Acq" --command="${Acq}" \
--tab ${xfce4Args} "${Ser}"
The argument to --command must be between double quote to make sure xfce4-terminal see it one argument event though it might contains spaces. So for --command="${Acq}" this works fine. For the second tab, ${Ser} does not work. If Ser does not contain the --title=Per its space separator, it works, because "${Ser}" becomes one argument that is understood. But with the --title=Per the arguments are no longer understood as separate arguments.
Even with my reading on the subject I have not been able to come up with a working solution. I was going to attempt using eval but seems too desparated and decided asking around .