On Fri, Apr 10, 2009 at 12:02:56AM -0700, lehe wrote: > The reason why I don't use "$@" is that the arguments to the bash script is > not completely those for the executable. Some of them are just arguments > only to the bash script. So actually the script is like
So you need to build up an *array* of your parameters, not a string. What you are trying to do does not, and cannot, work. > [code] > #!/bin/bash > ... > ${DEBUGGER} my_executable ${ARG_OPTS} > [/code] You have built up a string. There is no way to delimit individual parameters inside a string other than whitespace, and when you need whitespace *inside* one of those parameters, you're stuck. You need an array instead, as others have already told you. [code] #!/bin/bash ... $DEBUGGER my_executable "${my_arr...@]}" [/code] See also: http://mywiki.wooledge.org/BashFAQ/050 "I'm trying to put a command in a variable, but the complex cases always fail!" http://mywiki.wooledge.org/BashFAQ/005 "How can I use array variables?"