[net.general] ITER: a utility for iterating commands over sets of operands

kevin (04/20/83)

If you would like to try the "UNIX command iterator", described herein, or if
you know of any other tools like it, plse MAIL to decvax!muvax!vmucnam!kevin.

I have recently built the UNIX version of this tool, taking many ideas
from the VAX/VMS prototypes that I worked on (at DEC) for a few years.
I'm now at the point where ITER is stable enough to be distributed, but
since it's still a prototype (awaiting integration into a multi-screen
multi-window mouse-selecting environment) I'd very much like to get feedback
now about what it's like to use ITER, how it can be improved, etc.
---
ITER is a shell-command iterator in a rather general sense.  You combine
the notion of a "template command" with a "set of operands", and ITER will
issue the instantiated command once for each operand in the set.  It is
somewhat like a FOREACH only you have LOTS of control, including INTERRUPT
which leaves you in the middle of the iteration and in "query mode", etc.

For example:
		$ cat front_end BL3changes | grep '.c' | iter -q cc -c

is a pipeline which will ITER the 'cc -c' command over all C files (but not
the others) listed in the UNION of the two files shown.
The -Q flag asks to enter the ITER question-and-answer sub-system directly,
so you could interactively select the ones you really wanted to compile.
The command template could just as easily have been "emacs", or even one 
in which the placement of the operand is specifically given,
as in:
	$ iter -s myfiles cp %e /tmp/kevin/%e.V1.0

where the `%e' sequences are replaced by the args each time around the loop,
and -s lets you tell ITER to read "the set of operands" from a named file.

The real power of ITER is its flexibility and its simplicity.  For example,
the -Q above (for 'query') lets you enter a mode kinda like MORE or NEWS
where you have a host of options available to control the iteration.  Also,
you can leave ITER running unattended in a window and as long as things go OK,
it simply continues.  If an error occurs, ITER stops and lets you regain 
control without losing context. Also, you can INTERRUPT any iteration and enter
query mode at any time.  In general, you "Yes" and "No" your way thru the
set, but there are many more options available that I won't describe here.

As a side issue, ITER is also an experiment in multi-language dialogues.
Since ITER was done in France, it can also "speak French" - you simply
invoke it via an alternate name or specify the language you prefer when
you invoke ITER.  The message-file methodology prototyped for this is
also something I'd like feedback on, or to hear about other efforts towards.

I have a working design document that I will make available via the net.
Ditto for ITER itself - I assume that UUCPs from FRANCE are viable.
The doc in the UNIX manual format, but contains lots of questions about
open issues relating to "command iteration" in general and to ITER in
particular.  The source for ITER is "standard, simple, C", and I don't use
any non-standard (non V7) library routines.  VMUCNAM is a bsd 4.1 machine,
but ITER has been moved to several other UNIXes (but not coherent, onyx,
sol, unos or any others that I'd like to see it made available on...)

If you don't have access to the net, I can be reached via ordinary MAIL
to: Kevin Pammett,
    INRIA,
    L'Institut National de Recherche en Informatique et en Automatique,
    Rocquencourt, B.P. 105,
    France.  78153			tel: 01-1-33-3-954-9021 ext 160

Feel free to make inquiries in English or in French.
Si vous voulez savoir plus d'ITER en francais, dites-le-moi.

				Enjoy - Bonne chance!
							Kevin Pammett