Re: Package maintainer script policy.
In article <firstname.lastname@example.org>,
Manoj Srivastava <email@example.com> 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,
firstname.lastname@example.org | eventually eliminating it. <*>
To UNSUBSCRIBE, email to email@example.com
with a subject of "unsubscribe". Trouble? Contact firstname.lastname@example.org