[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug

From: Colin Watson
Subject: Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417)
Date: Tue, 5 Apr 2011 20:47:31 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

On Tue, Apr 05, 2011 at 09:32:40PM +0200, Alexander Kurtz wrote:
> Am Dienstag, den 05.04.2011, 21:16 +0200 schrieb Nicolas de Pesloüan:
> > Why do you use construct like "${x}" instead of "$x"?
> Because code isn't written once and then stays untouched forever. It
> changes over time and may be used in situations you did not anticipate.
> Writing solid code (and in shell scripts that definitely includes
> quoting your variables) avoids unnecessary bugs like this one.

While I agree with the general sentiments here, I would like to point
out that "${x}" is rigorously identical to "$x" in shell.  "Quoting your
variables" refers to the "", not to the {}.  It appears to be a common
misconception that {} has some quote-like semantics; it does not.  As
Nicolas says, it exists purely to separate variable names from
subsequent text that would otherwise be part of the name.

Colin Watson                                       address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]