"Yoshinori K. Okuji" <[EMAIL PROTECTED]> 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 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel