Executing a series of commands? 
Author Message
 Executing a series of commands?

I haven't been able to find a way to execute a series of commands,
perhaps stored in a text file. What I'd like to do is to be able
to store a series of commands in a text file and then do something to
cause all those commands to be executed. I know all these commands are
parameterless procedures, so I could call them directly, but I haven't
been able to come up with a simple way to put a string where the rest
of the command should be. For instance, I know I can call

        System.Watch

from inside a program, but how can I call

        System.Free Test ~

from within compiled code?

Ideally, I'd like to be able to do both of these things, these being
the equivalent of the unix script and system("") facilities, respectively.

Any ideas?

-greg
--
Greg DeLozier/Senior Scientific Analyst/L{*filter*}Defense Systems



Mon, 23 Oct 1995 22:40:17 GMT  
 Executing a series of commands?

Quote:

>I haven't been able to find a way to execute a series of commands,
>perhaps stored in a text file.

There's a sample program (maybe only in the MacOberon release) called
Automatic.Mod. It provides a command that runs a sequence of other
commands. If it doesn't do what you want, it's at least a start. Look
at the code.

Quote:
>                                         I know all these commands are
>parameterless procedures, so I could call them directly, but I haven't
>been able to come up with a simple way to put a string where the rest
>of the command should be.

You put it in the same place you got your own arguments from - the
global variable Oberon.Par. You'll need to fake up a text and a
viewer for them to be in. Alternatively, you could operate on a viewer
instead of a file, either using the * marker or putting your command
in the menu line (or, for extra marks, both).

Note that the garbage collector won't run until your script has finished.
This could be a problem with some commands, like the compiler.

Sean Case
--

"Zut! A woman farmair liveeng weez a mernkee who eats brie!
 Ah will make Chief Statistician weez zees!"  --  Colquhoun



Tue, 24 Oct 1995 18:36:31 GMT  
 Executing a series of commands?

Quote:

>Note that the garbage collector won't run until your script has finished.
>This could be a problem with some commands, like the compiler.

Running it by hand (xxxx.gc) might help.
Thomas


Tue, 24 Oct 1995 20:14:39 GMT  
 Executing a series of commands?
Actually, the compiler (being maintained by people who know their way
around the Oberon system) does something verboten: it calls the GC
*explicitly* between the compilation of individual source files. This
can be done as long as you can guarantee that all dynamic structures are
rooted in global variables; in the case of the compiler this applies to
the scanner that parses the list of files to be compiled.

However, this might interfere with "Automatic" ... Either use compiler
option "/g", which turns off the GC, or make sure that Automatic leaves
no dynamic data anchored to local variables.

Michael



Tue, 24 Oct 1995 22:40:25 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Scheme for Psion Series 3a or Series 5?

2. How do I execute a shell command and capture the standard output

3. VW -- How to execute DOS commands

4. execute unix command

5. reading a line and executing a command on that line

6. getting the return value of a command executed on another host

7. Can I execute shell commands from awk?

8. execute shell command and store output

9. executing Shell commands

10. Help: Executing shell commands under OS X PB.

11. Executing systems commands

12. executing a shell command within AWK

 

 
Powered by phpBB® Forum Software