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