1 |
On Sunday 05 April 2009 03:49:52 Duncan wrote: |
2 |
> Mike Frysinger <vapier@g.o> posted |
3 |
> >> + local sources="$@" |
4 |
> > |
5 |
> > this doesnt do what you think it does. it's the same as "$*" which |
6 |
> > means this function does not handle quoted arguments properly. |
7 |
> |
8 |
> ?? |
9 |
> |
10 |
> I'm confused. Maybe you meant something different, but quoting the bash |
11 |
> manpage (reformatted slightly to emphasize the difference, this is the |
12 |
> 4.0, 2009 February 7 manpage version, but a quick google indicates the |
13 |
> same difference applies in the POSIX shell spec well... it's not new): |
14 |
|
15 |
what you've read/quoted matters at the expansion step, but that isnt what i'm |
16 |
talking about. i'm pointing out that the expansion is lost by assigning |
17 |
through the variable. thus the same behavior of the whole function is as if |
18 |
"$*" is used. |
19 |
|
20 |
trivial example: |
21 |
set -- a "b c" d |
22 |
printf "{%s} " "$@" ; echo |
23 |
sources="$@" |
24 |
printf "{%s} " "$sources" ; echo |
25 |
printf "{%s} " $sources ; echo |
26 |
-mike |