[net.micro.amiga] Creating NEWCLI, using Execute

dillon@CORY.BERKELEY.EDU (Matt Dillon) (03/11/86)

	This is definately a design problem.  There are actually two
I/O structures used.  You have the kernal  BeginIO() etc.... and then
you have File Handles.  There do not seem to be any routines to convert
from one to the other.  This is most definately needed (and actually feasible).

	Execute (name, input_file_handle, output_file_handle);

	If name is "" (0-length string), then the program executed is a
newcli.  HOWEVER, there is a problem.  While writing my shell program, I
found that simply passing 0 (or even Input() and Output()) as the File
Handles to Execute() do not work when the handles are for your tty.  When
I attempted to:

	Execute ("shell", Input(), Output())

from my shell, it executed the shell (now a shell within a shell), but
immediately got an EOF and exited the second shell.  My solution is to not
bother with the second and third parameter ... Execute(name, 0, 0), and
provide the input and output streams by specfying '>*' and '<*' as part of
the name.  That is:

	Execute ("shell <* >*", 0 ,0);

In the latter case, I get a shell within a shell, and I can then type 
commands et all.... then quit (or type Ctl-\) and get back to my original
shell.

Thus, in SHELL, a >* and <* are appended to any command you execute (that
is not internal).  Of course, I scan the command string for '>' and '<'
and replace the appropriate defaults '>*' or '<*' with whatever you specified.


				-Matt

P.S.  I would still like to know how to 'wait' on both a set of signals as
per normal PLUS a particular File Handle (a RAW: fh, for instance, waiting 
for keyboard input)