Mike Frysinger <[email protected]> posted
[email protected], excerpted below, on  Sat, 04 Apr
2009 23:53:29 -0400:

>> +    local sources="$@"
> 
> this doesnt do what you think it does.  it's the same as "$*" which
> means this function does not handle quoted arguments properly.

??

I'm confused.  Maybe you meant something different, but quoting the bash 
manpage (reformatted slightly to emphasize the difference, this is the 
4.0, 2009 February 7 manpage version, but a quick google indicates the 
same difference applies in the POSIX shell spec well... it's not new):

*  Expands to the positional parameters, starting from one.
   When the expansion occurs within double quotes, it  expands
   to a single word with the value of each parameter separated
   by the first character of the IFS special variable.

   That is, "$*" is equivalent to "$1c$2c...", where c is the
   first character  of  the value of the IFS variable. [snip]

@  Expands to the positional parameters, starting from one.
   When the expansion occurs within double quotes, each parameter
   expands to a separate word.

   That is, "$@" is equivalent to "$1" "$2" ... [snip]

So they are treated differently within double-quotes (which were used) 
and "$@" is NOT the same thing as "$*".  But maybe I /did/ miss your 
intended meaning.  ??

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


Reply via email to