From owner-freebsd-bugs Mon Jun 2 07:06:22 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id HAA20635 for bugs-outgoing; Mon, 2 Jun 1997 07:06:22 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id HAA20624 for ; Mon, 2 Jun 1997 07:06:10 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id AAA31991; Tue, 3 Jun 1997 00:03:16 +1000 Date: Tue, 3 Jun 1997 00:03:16 +1000 From: Bruce Evans Message-Id: <199706021403.AAA31991@godzilla.zeta.org.au> To: freebsd-bugs@hub.freebsd.org, Harlan.Stenn@pfcs.com Subject: Re: conf/3751: Improvements to /etc/rc{,.network,.pccard} Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > J> That's not entirely confusing syntax. It's normal habit to be on the > J> safe side. Although i agree, the quotes should always be there, > > Agreed (obviously) It's not obvious. '[ X$foo_enable = XYES ]' is better than '[ "X$foo_enable" = XYES ]' for boolean variables, since it detects some bogus values. > J> Prepending the X saves you from hidden gotchas like in: > > J> foo="-ain't this weird?-" > > J> if [ "$foo" = "bar" ] ; ... > > Did you mean: > > if [ $foo = "bar" ] ; ... > > Shell metacharacters aren't expanded with "$foo". I think he meant foo="!" Some strings may be misinterpreted as options or operators. There is no problem in most cases because test's syntax gives precedence to the "=" operator, e.g., in [ -a = bar ] Bruce