Re: Package maintainer script policy.
In article <email@example.com>,
Manoj Srivastava <firstname.lastname@example.org> wrote:
> See? $nosuch and "$nosuch" are not the same thing. Never have
> been. To drive the point home, try this little shell function that
> reports the number of positional arguments and the values.
Yes, well, but the rules are different for normal variables and $@.
Now if you were talking about $* you would be right.
$ bash -c '[ "$@" = whatever ]'
bash: [: =: unary operator expected
exec program "$@"
is indeed _the_ preferred way to pass arguments unchanged, but you really
have to understand the very subtle differences between $* and $@.
$ bash -c 'set 1 2 3; set "$*"; echo $#'
$ bash -c 'set 1 2 3; set "$@"; echo $#'
See? "$@" expands to _three_ strings. Cool, huh?
Miquel van Smoorenburg | Our vision is to speed up time,
email@example.com | eventually eliminating it. <*>
To UNSUBSCRIBE, email to firstname.lastname@example.org
with a subject of "unsubscribe". Trouble? Contact email@example.com