[net.micro.amiga] CLI RUN command

bobp@amiga.UUCP (Robert S. Pariseau) (11/22/85)

The AmigaDOS Execute() function does indeed use the c:run program to start
up a new process context and get your process going.  For instance,
the ABasiC "shell" and "dir" statements both use Execute() to get their
job done and, thus, expect to find the run program in the c: directory.

This is done to centralize command parsing (things like the ">" and "<"
I/O redirection stuff).

When you type in a CLI command name, the program you identify is started
as a *>co-routine<* of the CLI process.  (Note to UNIX hackers, this is
a co-routine, not a fork.)

When you type in "run program_name parameters", the program you identify
is started up as a *>new<* process and runs asynchronously in its own
process context.  The message "[CLI number]" that you see printed
out is an indication of the new CLI being created to execute the new
process.  (By the way, CLI's are pretty low overhead thingies -- they
basically establish standard-in and standard-out for the new process.)

The NewCLI command is somewhat different.  It, itself, starts a new
process running in a new window and establishes a CLI running
interactively in that window.  (Use the EndCLI command within the new
window to make it go away.)

Thus if you want multi-tasking of CLI commands in separate windows,
use the NewCLI command to startup the new windows and then type the
commands directly into the new windows.

If you want multi-tasking of CLI commands in the *>SAME<* window,
type in your CLI commands prefixed by the RUN command.

For instance, I usually type

     1> run ed filename

when I want to use the screen editor.  This leaves my CLI free for
other things in the background.  If I need to get a directory listing,
I just push the ed window to the back (using the depth arranger gadgets
in its upper right corner) and there's my CLI ready and able to
accept my dir command!  This is a pretty typical use.  It works well
here because the ed program opens up its own window to get things done,
thus there's no confusion in my normal CLI window.