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                                       [cjwat...@ubuntu.com]

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to