Subject: Re: CVS commit: src/etc/rc.d
To: Christos Zoulas <christos@astron.com>
From: David Laight <david@l8s.co.uk>
List: source-changes
Date: 02/15/2007 21:05:18
On Thu, Feb 15, 2007 at 04:54:23PM +0000, Christos Zoulas wrote:
> >
> >Log Message:
> >Remove unnessary "if [ X"$foo" ... ]" hack which is not necessary if
> >you quote things properly which this script does.
> >
> 
> quoting does not help you if the variable expansion ends up starting
> with "-".

In this case test(1) is being called with three arguments, so posix
requires that the middle one be treated as the operator.
Posix is very specific about the bahaviour of test(1) for small numbers
of arguments, and explicitly states it is undefined for larger numbers.

	David

-- 
David Laight: david@l8s.co.uk