Bourne shell "if" syntax

jb jb.1234abcd at
Mon Jun 10 19:53:03 UTC 2013

Michael Sierchio <kudzu <at>> writes:

> ... 
> Right.  Many scripts seem to assume that sh is bash, and that's
> certainly not the case here.
> if [ "x$BLAH" = "x" ]; then
> is the most reliable and portable way of determining if it's a string
> of zero length.

Actually this trick is not needed any more (it has not been required for
long time because the problem was fixed).


More information about the freebsd-questions mailing list