Reference Manual


shell - invoke a shell in a named window
shell [name [columns:rows]]

Command shell creates a window with the specified name. If no name is specified, no window is created and command execution continues in the current window. A command interpreter (shell) is then invoked and the named (or current) window becomes that shell's standard I/O Device. The optional argument specifies the window's dimensions (in characters).

The NAT32 shell supports the concurrent execution of commands, and also includes full support for command pipelines and redirection.

Commands are executed concurrently as separate threads, and each thread inherits the standard I/O devices of its parent. The shell normally blocks until all child threads have terminated, but this behaviour can be overridden with the & operator.

Command pipelines allow multiple commands to be executed concurrently. The output of one command is piped as input to the next command. Command pipelines of up to 9 commands can be executed. The pipe operator is the | character.

Redirection consists of setting the standard I/O devices of a command to something other than the default. The operators are:

< Standard Input
> Standard Output
^ Standard Error
Redirection can be to any device. Note that NAT32 treats files, windows, pipes and network connections as devices.

NAT32 is currently configured to support 8 window devices, 16 pipes, 16 files and 16 TCP connections.

A NAT32 command is defined as follows:

When NAT32 starts, it initializes all devices, including the CONSOLE window device. It then executes the commands in file startup.tmp, that was generated out of the file startup.txt in the current directory. When the last command in file startup.tmp has completed, NAT32 deletes the file and executes file exit.txt. After uninitializing all devices, NAT32 returns to its caller (usually the host Operating System). Because the last command in startup.tmp is normally a shell command, NAT32 does not exit until all shells have terminated.
A complete list of NAT32 commands can be viewed by typing: help
A manual page for each command can be viewed by typing: help cmd

If a command file to be executed by the shell contains commands of the form:

#!cmd [arg]+
the command cmd is executed with the specified arguments plus all other arguments which were passed to the shell when the command file was invoked.


If a script file test contains the line: #!echo Testing
then typing: test 123 will produce the output: Testing test 123

In any window device, pressing Ctrl-F4 will create a new shell.

Any Windows program can be launched from a NAT32 shell by using command exec. This will run the program as an independent Windows Process.

exec exit nat32 sh startup tcl termin