On Mon, Jun 10, 2013 at 12:16 PM, Tim Daneliuk <tun...@tundraware.com> wrote:

> That wasn't really my point.  I use sentinels because in the face of an
> empty string this:
>
>    if [ $PTR = "" ]
>
> Actually evaluates to:
>
>    if [ = "" ]
>
> Which throws an error.

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.

- M
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to