[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
- [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417), Alexander Kurtz, 2011/04/05
- Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417), Nicolas de Pesloüan, 2011/04/05
- Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417), Colin Watson, 2011/04/05
- Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417), Alexander Kurtz, 2011/04/05
- Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417),
Colin Watson <=
- Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417), Nicolas de Pesloüan, 2011/04/05
- Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417), Colin Watson, 2011/04/05
- Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417), Nicolas de Pesloüan, 2011/04/05
- Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417), Alexander Kurtz, 2011/04/06
- Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417), Nicolas de Pesloüan, 2011/04/06
- Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417), Colin Watson, 2011/04/06
- Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417), Nicolas de Pesloüan, 2011/04/06
- Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417), Vladimir 'φ-coder/phcoder' Serbinenko, 2011/04/08
- Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417), Alexander Kurtz, 2011/04/09
- Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417), Vladimir 'φ-coder/phcoder' Serbinenko, 2011/04/10