[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Package maintainer script policy.

In article <87hfzsv7nj.fsf@tiamat.datasync.com>,
Manoj Srivastava <srivasta@datasync.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

See? ;)

	exec program "$@"

is indeed _the_ preferred way to pass arguments unchanged, but you really
have to understand the very subtle differences between $* and $@.

Another one:

$ 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,
    miquels@cistron.nl  |   eventually eliminating it.     <*>

To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: