Eric Blake <e...@byu.net> writes:

> According to Simon Josefsson on 4/1/2009 9:30 AM:
>>> Even though Posix says this should silently return non-zero exit status,
>>> some test implementations complain to stderr if the argument starts with
>>> something that looks like an operator or option.  Hence, any time you are
>>> validating the contents of a variable that can be set outside of your
>>> control, you should always prefix it with x, to ensure that it doesn't
>>> start with -, (, ), etc.
>> 
>> "test implementations"?  If there aren't any more widely deployed
>> implementations out there that break (like irix, hpux or some other
>> system that we do support), IMO it makes the code harder to read for no
>> good reason and that we are better off making people stop use these test
>> implementations.
>
> test(1) is often a shell builtin.

Ah, sorry, I thought you meant experimental shell implementations.

> And we support a wide variety of shells, very many of which do not
> comply with POSIX.  For example, Solaris /bin/sh.  This portability
> pitfall is documented in the autoconf manual.

I've read it now, thanks for the pointer.

/Simon


Reply via email to