Shell works by concatenating its arguments (separated by spaces), writing them to a temporary command file, optionally copying the stdin byte input lattice to another temporary file, then running the shell using the command file. The standard output and standard error of the shell are optionally redirected to other temporary files. The latter is sent in a module alert to the UI, while the former is optionally piped to the output byte lattice port. The error code of the system() call that invoked the shell is returned as a parameter.
As an example, you can use Shell to list the files in the current directory. Type "ls" in the Command typein (under Windows NT, type "dir" instead). Shell runs the ls or dir command and sends the result to the output port. Click on "StdOut => UI" and the output of the ls command will appear in the usual manner of tty output from Explorer. Now click on "StdOut => Port" and wire the output port to PrintLat. Select character byte data and turn data printing on. You should again see the ls or dir output, but now presented by the UI as arriving from the PrintLat module.
Port: Std In
Type: Lattice
Optional: This port is optional
Constraints: 1-vector.
byte.
Optional Standard Input data
Port: Command
Type: Text
Shell command or program to invoke.
Port: Shell Type
Type: Option Menu
Menu Item: Bourne
Menu Item: C
/bin/sh or /bin/csh
(N.B. under Windows NT, this widget is hidden - only the regular command
interpreter CMD.EXE is available).
Port: First Arg
Type: Text
Additional shell arguments.
Port: Second Arg
Type: Text
Additional shell arguments.
Port: Third Arg
Type: Text
Additional shell arguments.
Port: Fourth Arg
Type: Text
Additional shell arguments.
Port: StdOut Dest
Type: Option Menu
Menu Item: Window
Menu Item: Port
Send standard out to byte output lattice or let the UI pick it up.
Port: StdIn Src
Type: Option Menu
Menu Item: TTY
Menu Item: Port
Take stdin from input port or from tty.
Port: Std Out
Type: Lattice
Constraints: 1-D.
1-vector.
byte.
uniform.
Optional Standard Output data.
Port: Return Status
Type: Parameter
What the shell returned.