Date: Mon, 2 Jun 1997 02:00:01 -0700 (PDT)
From: Harlan Stenn <Harlan.Stenn@pfcs.com>
To: freebsd-bugs
Subject: Re: conf/3751: Improvements to /etc/rc{,.network,.pccard}
Message-ID: <199706020900.CAA08467@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR conf/3751; it has been noted by GNATS.
From: Harlan Stenn <Harlan.Stenn@pfcs.com>
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199706020900.CAA08467>
