From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1GVTfj-0007wJ-If for mharc-grub-devel@gnu.org; Thu, 05 Oct 2006 09:53:59 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GVTfi-0007w0-Dk for grub-devel@gnu.org; Thu, 05 Oct 2006 09:53:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GVTfh-0007va-HD for grub-devel@gnu.org; Thu, 05 Oct 2006 09:53:58 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GVTfh-0007vX-Al for grub-devel@gnu.org; Thu, 05 Oct 2006 09:53:57 -0400 Received: from [195.54.107.76] (helo=mxfep03.bredband.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GVTmM-0006mm-Ay for grub-devel@gnu.org; Thu, 05 Oct 2006 10:00:50 -0400 Received: from ironport2.bredband.com ([195.54.107.84] [195.54.107.84]) by mxfep03.bredband.com with ESMTP id <20061005135356.VUNA14075.mxfep03.bredband.com@ironport2.bredband.com> for ; Thu, 5 Oct 2006 15:53:56 +0200 Received: from c-e5df71d5.029-19-73746f13.cust.bredbandsbolaget.se (HELO localhost.localdomain) ([213.113.223.229]) by ironport2.bredband.com with ESMTP; 05 Oct 2006 15:53:56 +0200 From: Johan Rydberg To: The development of GRUB 2 References: <87fye2swwa.fsf@xs4all.nl> Date: Thu, 05 Oct 2006 16:19:31 +0200 In-Reply-To: <87fye2swwa.fsf@xs4all.nl> (Marco Gerards's message of "Thu, 05 Oct 2006 15:41:09 +0200") Message-ID: <87fye29764.fsf@night.trouble.net> User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Cc: Subject: Re: Scripting (IMPORTANT!) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2006 13:53:58 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable Marco Gerards writes: > Iterating over files: > for x in (hd0,3)/foo/* ; do commands ; done I must say I would prefer this over the other ("foreach") suggestion, since I'm more used to it.=20 Anyhow, is your plan to make expansion available through out the whole shell, or only for "for"? It would be nice to be able to do; grub> ls (*,*)/boot/vmlinuz* > One special purpose variable $ERROR will be added. It will contain > the error strings when $? is set to non-zero. In that case you can do > error handling in scripts. I'm afraid there might be situations where the user do not realize that $ERROR has been overwritten. Bogus example; if cat (hd0,1)/foo/bar; then=20 ls (hd0,1)/foo echo "*** 'bar' is missing: $ERROR" fi The execution of 'ls' will overwrite $ERROR. ~j --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQBFJRR23CqIy3K3X2ERAhWEAJ41dqZBiHFzRixPeY5pM07wTK+B/wCfUJD1 pZyG2a+aQNQHn+jbMEXL6vk= =s05Y -----END PGP SIGNATURE----- --=-=-=--