argument with space passed to bash script and further to executable
I'd like to pass arguments with space inside to a bash script and further into an executable called inside the script. My bash script looks like:
one of the arguments to the executable is like
while [[ -n "$1" ]];
To prevent it from being splitted by the spaces when first passing to the bash script, i.e. "--options='-t", "0", "-v" and "0", I double quote it as
--options='-t 0 -v 0'
So '-t 0 -v 0' as a whole will be able to preserved until reaching the command invoking the executable. However '-t 0 -v 0' is not passed as a whole into the executable, but split by spaces again. This may sounds like it is the problem of calling the executable, however when directly invoking the executable from terminal
"--options='-t 0 -v 0'"
could be passed successfully as argument. So can
my_executable --options='-t 0 -v 0'
my_executable --options="-t 0 -v 0"
Hope that I could explain my question clearly. Shall I change the argument format or the bash script. Really appreciate your advice!