From owner-freebsd-bugs Mon Jun 2 02:00:03 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA08505 for bugs-outgoing; Mon, 2 Jun 1997 02:00:03 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA08467; Mon, 2 Jun 1997 02:00:01 -0700 (PDT) Date: Mon, 2 Jun 1997 02:00:01 -0700 (PDT) Message-Id: <199706020900.CAA08467@hub.freebsd.org> To: freebsd-bugs Cc: From: Harlan Stenn Subject: Re: conf/3751: Improvements to /etc/rc{,.network,.pccard} Reply-To: Harlan Stenn Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk The following reply was made to PR conf/3751; it has been noted by GNATS. From: Harlan Stenn To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: conf/3751: Improvements to /etc/rc{,.network,.pccard} Date: Mon, 02 Jun 1997 04:56:19 -0300 >>> On Mon, 2 Jun 1997 08:50:31 +0200, j@uriah.heep.sax.de (J Wunsch) said: H> -if [ $1x = autobootx ]; then +if [ "$1" = autoboot ]; then 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) J> and the X should always be prepended. I don't think it should ever be there, but if it must be there, it should be prepended. 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". Regardless, if you're talking about the shell metacharacter problem, I'd disagree with you about the "hidden gotcha". Quoting and shell metacharacters are such basic concepts that anybody who writes a shell script should be aware of them. And besides, invoking "sh -x script" will quickly show the problem. As an aside, in "rc" the quoting checking vi.recover is also inconsistent... H