1 |
Marijn Schouten (hkBst) wrote: |
2 |
>> |
3 |
http://overlays.gentoo.org/proj/emacs/browser/emacs-overlay/eclass/xemacs-elisp-common.eclass |
4 |
> |
5 |
> You use $* and $@ here which are the same when unquoted. They should |
6 |
> probably be quoted and that means that all instances would become the four |
7 |
> characters "$@". |
8 |
> |
9 |
Yeah, that's definitely how to pass thru parameters in function calls. |
10 |
|
11 |
<greybot> The difference between $@ and $*: without double quotes, none at |
12 |
all: both equal $1 $2 .... With double quotes, "$@" is "$1" "$2" ..., |
13 |
while "$*" is "$1c$2c..." (where c is the first character of $IFS). You |
14 |
almost always want "$@". |
15 |
|
16 |
So using "$*" maps to one string parameter. If you're calling a shell |
17 |
function you might not notice the difference (until you use a parameter |
18 |
with a space) using plain $* since the shell splits parameters to commands |
19 |
on characters in IFS. The point is, to deal with spaces in strings you need |
20 |
to use "$@". |
21 |
|
22 |
#bash is your friend (although some of the ops are way too grumpy ;) |
23 |
|
24 |
|
25 |
-- |
26 |
gentoo-dev@g.o mailing list |