1 |
Mike Frysinger <vapier@g.o> posted |
2 |
200904042353.30988.vapier@g.o, excerpted below, on Sat, 04 Apr |
3 |
2009 23:53:29 -0400: |
4 |
|
5 |
>> + local sources="$@" |
6 |
> |
7 |
> this doesnt do what you think it does. it's the same as "$*" which |
8 |
> means this function does not handle quoted arguments properly. |
9 |
|
10 |
?? |
11 |
|
12 |
I'm confused. Maybe you meant something different, but quoting the bash |
13 |
manpage (reformatted slightly to emphasize the difference, this is the |
14 |
4.0, 2009 February 7 manpage version, but a quick google indicates the |
15 |
same difference applies in the POSIX shell spec well... it's not new): |
16 |
|
17 |
* Expands to the positional parameters, starting from one. |
18 |
When the expansion occurs within double quotes, it expands |
19 |
to a single word with the value of each parameter separated |
20 |
by the first character of the IFS special variable. |
21 |
|
22 |
That is, "$*" is equivalent to "$1c$2c...", where c is the |
23 |
first character of the value of the IFS variable. [snip] |
24 |
|
25 |
@ Expands to the positional parameters, starting from one. |
26 |
When the expansion occurs within double quotes, each parameter |
27 |
expands to a separate word. |
28 |
|
29 |
That is, "$@" is equivalent to "$1" "$2" ... [snip] |
30 |
|
31 |
So they are treated differently within double-quotes (which were used) |
32 |
and "$@" is NOT the same thing as "$*". But maybe I /did/ miss your |
33 |
intended meaning. ?? |
34 |
|
35 |
-- |
36 |
Duncan - List replies preferred. No HTML msgs. |
37 |
"Every nonfree program has a lord, a master -- |
38 |
and if you use the program, he is your master." Richard Stallman |