Subject: Re: bin/24256: Some shell scripts pass arguments the wrong way
To: Christian Biere <christianbiere@gmx.de>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 01/27/2004 16:26:11
[ On , January 27, 2004 at 05:35:36 (-0000), Christian Biere wrote: ]
> Subject: bin/24256: Some shell scripts pass arguments the wrong way
>
> The correct way of passing through arguments "as-is", is to use ${1+"$@"}.
> Everything else won't handle blanks in the arguments properly.

This can be simplified to just "$@" with any shell newer than the
original V7 shell.

The trick of wrapping it with "${1+}" was to work around a known bug in
the original Bourne shell that was found on 7th Edition Unix (and which
persisted for many years on other derivatives of that release, including
4.3BSD.  Even back in about 1989 or so I couldn't find any production
systems where just plain "$@" wasn't sufficient, well except for some
ancient-even-then Symmetrix boxes the company I was working for at the
time were still maintaining for the Canadian Armed Forces, though I
suppose we could have fixed the shell bug for them.  :-)

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>