[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: problem with xml tests

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2002-01-21 21:14:23 CET

On Mon, 2002-01-21 at 15:04, Sander Striker wrote:
> > if test "$foo" = "bar"; then
> >
> >
> > The [ ] implies test, but it seems like I heard that some shells don't
> > understand the brackets. Dunno that you need to worry about that; we've got
> > a number of other problems if that is the case... :-)
>
> In that case, consider us having problems and file an issue.
> We need to use 'test' for portability, since that is known to
> always work.

Whoa, there. I have never run into a platform where [] fails and "test"
works. Since [] is much more readable, we shouldn't change all the
instances of [] to "test" unless someone can come up with a concrete
reason. Good portability practice is not about jumping at shadows.
(Which is why I think we should use size_t instead of apr_size_t, but I
didn't mangae to win that argument.)

(An interesting case to consider is when "$foo" begins with a hyphen,
producing an expression like [ -r = blah ]. Fortunately, test seems to
handle this case correctly--that is, as an equality test--on all the
platforms I have access to at the moment.)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:57 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.