[comp.sys.amiga] Need help using eval in scripts

amr@dukee.egr.duke.edu (Anthony M. Richardson) (05/28/90)

I'll probably feel pretty silly for not being able to figure this out
myself, but I've already gone well beyond my frustration level...

How does one use eval if you want to read one of the parameters from
an input file (or environment variable)?  The 1.3 manual (the little
white book) I have says you can do this and even gives an example
that goes something like (from memory)

  eval < t:qwe value2=1 op=- to env:loop

This is supposed to decrement the value in qwe and store the new value
in loop and allows you to do loops.  I've tried this and can't get
it (or any seemingly logical permutations to work).

Can anyone help?

Thanks in advance,
Tony

p.s. I already know that several PD and commercial shells can do this
quite easily, but I really want to know how to do it with eval and the
standard commodore shell.

jsivier@ux1.cso.uiuc.edu (Jonathon Sivier ) (06/03/90)

In article <918@cameron.egr.duke.edu> amr@dukee.egr.duke.edu (Anthony M. Richardson) writes:
>How does one use eval if you want to read one of the parameters from
>an input file (or environment variable)?  The 1.3 manual (the little
>white book) I have says you can do this and even gives an example
>that goes something like (from memory)
>
>  eval < t:qwe value2=1 op=- to env:loop

  I think one thing you have to do if you are going to use input redirection
with '<' is to redifine the braket characters to something like '{}'.
Otherwise the parser see's the '<' as the beginning of an input parameter.
I hope this helps some.

-- 

Jonathan Sivier
jsivier@ux1.cso.uiuc.edu

peterk@cbmger.UUCP (Peter Kittel GERMANY) (06/08/90)

In article <918@cameron.egr.duke.edu> amr@dukee.egr.duke.edu (Anthony M. Richardson) writes:
>How does one use eval if you want to read one of the parameters from
>an input file (or environment variable)?  The 1.3 manual (the little
>white book) I have says you can do this and even gives an example
>that goes something like (from memory)
>
>  eval < t:qwe value2=1 op=- to env:loop
>       ^^^
Well, in the print shops with their proportional fonts it becomes often
VERY difficult to tell where a space should go and where not.
This statement deals with redirection of input, so there MUST NOT BE A
SPACE in  "<t:qwe"   !!!

BTW, in my version this whole part of the script looks a bit different:
type env:loop
eval <env:loop >NIL: to=t:qwe{$$} value2=1 op=- ?
copy t:qwe{$$} env:loop  ; don't abuse type where copy is meant



-- 
Best regards, Dr. Peter Kittel       E-Mail to 
Commodore Frankfurt, Germany         rutgers!cbmvax!cbmbsw!cbmger!peterk