Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Q7CE3-000849-W0 for mharc-grub-devel@gnu.org; Tue, 05 Apr 2011 15:47:44 -0400 Received: from [140.186.70.92] (port=48525 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7CE1-00081g-AG for grub-devel@gnu.org; Tue, 05 Apr 2011 15:47:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7CDy-000137-1C for grub-devel@gnu.org; Tue, 05 Apr 2011 15:47:40 -0400 Received: from smarthost01.mail.zen.net.uk ([212.23.3.140]:58946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7CDx-000123-R4 for grub-devel@gnu.org; Tue, 05 Apr 2011 15:47:37 -0400 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost01.mail.zen.net.uk with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Q7CDt-0007FS-RK for grub-devel@gnu.org; Tue, 05 Apr 2011 19:47:34 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 4.72) (envelope-from ) id 1Q7CDr-0002HR-P4 for grub-devel@gnu.org; Tue, 05 Apr 2011 20:47:31 +0100 Date: Tue, 5 Apr 2011 20:47:31 +0100 From: Colin Watson To: grub-devel@gnu.org Message-ID: <20110405194731.GI9163@riva.ucam.org> References: <1302008107.14852.20.camel@alexander> <4D9B6A7D.4090306@gmail.com> <1302031960.30533.7.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1302031960.30533.7.camel@localhost> User-Agent: Mutt/1.5.20 (2009-06-14) X-Originating-Smarthost01-IP: [82.69.40.219] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 212.23.3.140 Subject: Re: [PATCH] add proper variable quoting to grub-mkconfig_lib (Debian bug #612417) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2011 19:47:42 -0000 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 [cjwatson@ubuntu.com]