Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1GYU3v-0007NZ-49 for mharc-grub-devel@gnu.org; Fri, 13 Oct 2006 16:55:23 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GYU3t-0007LY-80 for grub-devel@gnu.org; Fri, 13 Oct 2006 16:55:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GYU3r-0007K0-Pk for grub-devel@gnu.org; Fri, 13 Oct 2006 16:55:20 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GYU3r-0007Jg-7p for grub-devel@gnu.org; Fri, 13 Oct 2006 16:55:19 -0400 Received: from [194.109.24.35] (helo=smtp-vbr15.xs4all.nl) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GYUCM-0007uZ-VG for grub-devel@gnu.org; Fri, 13 Oct 2006 17:04:07 -0400 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr15.xs4all.nl (8.13.8/8.13.8) with ESMTP id k9DKtGHx058954 for ; Fri, 13 Oct 2006 22:55:17 +0200 (CEST) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: <87fye2swwa.fsf@xs4all.nl> <200610132132.11614.okuji@enbug.org> <87d58wro1g.fsf@xs4all.nl> <200610132213.34486.okuji@enbug.org> Mail-Copies-To: mgerards@xs4all.nl Date: Fri, 13 Oct 2006 23:03:50 +0200 In-Reply-To: <200610132213.34486.okuji@enbug.org> (Yoshinori K. Okuji's message of "Fri, 13 Oct 2006 22:13:34 +0200") Message-ID: <878xjkrkqx.fsf@xs4all.nl> User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner 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: Fri, 13 Oct 2006 20:55:21 -0000 "Yoshinori K. Okuji" writes: >> >> ===== >> >> for >> >> ===== >> >> >> >> The for command can be used to iterate over a set of data. I don't >> >> like the idea of implementing this *exactly* like in bash. Personally >> >> I am thinking of the following syntax: >> >> >> >> Iterating over files: >> >> for x in (hd0,3)/foo/* ; do commands ; done >> > >> > How is this different from BASH? The asterisk is interpreted as a >> > wildcard, and this is not a part of "for" in BASH. >> >> You removed the relevant context. Right, GRUB has no wildcard. I >> don't really understand what you mean. > > I meant that the asterisk is not a part of a description for "for". It's good you mention this, because it's exactly the discussion I want to start. The question here is: How do we want to deal with the `for'? In bash it iterates over all arguments. The wildcards are expanded by the shell and thus it just has a look at its arguments. The question here is, do we want to deal with wildcards? It makes the code more complex and I think there is little gain. For GRUB I think some kind of iterators are more useful. In that case you can write a module to iterate over certain data. For example over files, disks, partitions, terminals or whatever. It leaves the bash syntax, but it is more useful in our case and modular. >> > This sounds too much for me. How about supporting a subset of "set" in >> > BASH? For example, set -d and set +d. The default can be set -d. >> >> What do you mean by "this"? I assume you mean -e instead of -d? I >> hope you can check what you really mean, a -d does not exist. > > Oops. Yes, I meant -e instead. Great! Thanks. I didn't know about "set -e", so I am happy you mentioned it. I will add this feature to our set. -- Marco