[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scripting (IMPORTANT!)
From: |
Marco Gerards |
Subject: |
Re: Scripting (IMPORTANT!) |
Date: |
Fri, 13 Oct 2006 23:03:50 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
"Yoshinori K. Okuji" <address@hidden> 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
- Scripting (IMPORTANT!), Marco Gerards, 2006/10/05
- Re: Scripting (IMPORTANT!), Johan Rydberg, 2006/10/05
- Re: Scripting (IMPORTANT!), Johan Rydberg, 2006/10/05
- Re: Scripting (IMPORTANT!), tgingold, 2006/10/09
- Re: Scripting (IMPORTANT!), Hollis Blanchard, 2006/10/12
- Re: Scripting (IMPORTANT!), Yoshinori K. Okuji, 2006/10/13