clemon@lemsys.UUCP (Craig Lemon) (03/19/91)
I have a need for eval to incriment an environment variable. In the 1.3 manual it gives and example of how to use eval for this purpose : eval <env:loop >nil: to=t:qwe{$$} value2=1 op=-? My version so far is eval <env:seq to=t:tmpval value2=1 op=+? It returns a 'bad arguments' error. What's wrong? I shouldn't NEED to direct output to nil: (then I wouldn't know that it didn't work!) and I shouldn't need to include the process number in the to= field. What's going on here? If anyone can mail me a simple program to either generate Message-Ids to a file with no CRs from the UULIB:seq file and then incriment this file, or send me a C program to incriment a file (env:seq) I'll be happy too. I'm trying to write a mail-news gateway script to accept all cases. I need to add a Path: line to my alt.sys.amiga.uucp mailing list entry so it doesn't try to mail upstream (don't ask, trust me) and I need to add a Newsgroups: and Message-Id: line in the case of normal mail. My problem is generating the message-id. I though of using the output from 'date' but that didn't pan out (CR/LFs and spaces). I need an algorithm to generate Message-Ids really. -- Craig Lemon - Kitchener, Ontario. Amiga B2000/10--UUCP 1.06D/Gnews v1.1/UUCP+ clemon@lemsys.UUCP or lemsys!clemon@xenitec.on.ca | Mail any files to 'files' xenitec!lemsys!clemon@watmath.uwaterloo.ca | at site lemsys whatever ....!{uunet}!watmath!xenitec!lemsys!clemon | path you take :-)
peterk@cbmger.UUCP (Peter Kittel GERMANY) (03/19/91)
In article <7408.669349271@lemsys.UUCP> clemon@lemsys.UUCP (Craig Lemon) writes: > > I have a need for eval to incriment an environment variable. In >the 1.3 manual it gives and example of how to use eval for this purpose : > >eval <env:loop >nil: to=t:qwe{$$} value2=1 op=-? ^^^^^ should be op=- ? > My version so far is > >eval <env:seq to=t:tmpval value2=1 op=+? ^>NIL: ^^^^^ --> op=+ ? > It returns a 'bad arguments' error. What's wrong? I shouldn't >NEED to direct output to nil: (then I wouldn't know that it didn't work!) Well, two errors at once: First, you must separate the "?" with a space. That should have caused that "bad arguments" error. And then, you really NEED the ">NIL:", because this has to do just with that "?": The "?" normally tells a command that you want help and ask it to display the command template, and it prompts you for the result. Now this approach is used to get one argument from input redirection. The "?" evokes the template, but ">NIL:" sends the template output to India/Egypt, and the command searches for the argument input which it gets delivered by "<env:seq". What you also mentioned (getting a process list without CRs), is really difficult. Perhaps it gets easier with 2.0, but when it came to such problems in back times, the only solution was always to resort to EDIT (yuck) and struggle with it until I had the job done. EDIT is really stone-age, but it is (under 1.3 and without ARexx) the only editor capable of such filter jobs in scripts. -- Best regards, Dr. Peter Kittel // E-Mail to \\ Only my personal opinions... Commodore Frankfurt, Germany \X/ {uunet|pyramid|rutgers}!cbmvax!cbmger!peterk