TOOLS Commands SPAWN
Creates a subprocess of the current process. The context of
the subprocess is copied from the current process. You can
use the SPAWN command to leave the utility temporarily,
perform other functions (such as displaying a directory listing
or printing a file), and then return to .
Note that this command is only available for users with DCL
access.
Format
SPAWN [command]
Parameters
command
Specifies the DCL command string that executes in the
context of the created subprocess. When the command com-
pletes, the subprocess terminates and control is returned to
the parent process. If this parameter is not specified, a sub-
process is created that transfers control to DCL command
level.
Qualifiers
/INPUT=file-spec
Specifies an input file containing one or more DCL com-
mand strings to be executed by the spawned subprocess. If
you specify a command string along with an input file, the
command string is processed before the commands in the
input file. Once processing is complete, the subprocess is
terminated.
/LOGICAL_NAMES
/NOLOGICAL_NAMES
Specifies that the logical names of the parent process are to be
copied to the subprocess. When you do not want the subpro-
cess to use the logical names of the parent process, enter the
qualifier /NOLOGICAL_NAMES. The default is /LOGICAL_
NAMES.
/OUTPUT=file-spec
Identifies the output file to which the results of the SPAWN
operation are written. Whenever you use the /NOWAIT
qualifier, you should also use the /OUTPUT qualifier to spec-
ify a new output destination. Doing so prevents output from
being displayed while you are specifying new commands. If
you omit the /OUTPUT qualifier, output is written by default
to the current SYS$OUTPUT device.
/PROCESS=subprocess-name
Specifies the name of the subprocess to be created. The
default name of the subprocess is USERNAME_n. If the
subprocess name contains spaces or special characters, or is
case-sensitive, then the subprocess name must be enclosed in
quotation marks.
/SYMBOLS
/NOSYMBOLS
Determines whether the system passes DCL global and local
symbols to the subprocess. The default is /SYMBOLS.
/WAIT/NOWAIT
Controls whether the system waits until the subprocess is
completed before allowing more commands to be specified.
The /NOWAIT qualifier allows you to specify new commands
while the specified subprocess is running. If you specify
/NOWAIT, you should also use the /OUTPUT qualifier to di-
rect the output stream to a file, rather than displaying it on
your terminal. Doing so prevents your terminal from being
used by more than one process simultaneously.
Examples
1. > SPAWN SHOW TIME
This example shows how to create a subprocess that ex-
ecutes the DCL command SHOW TIME while you are
using utility.
2. > SPAWN /NOLOGICAL_NAMES SET HOST
_Node: MARS
.
.
.
$ LOGOUT
CRAMMER logged out at ...
%REM-S-END, control returned to node _BETA::
>
This example shows how to use the SPAWN command to
create a subprocess in which you SET HOST to another
node. When you want to leave node MARS and move
back to node BETA, enter the DCL command LOGOUT.
The /NOLOGICAL_NAMES qualifier prevents the logi-
cal names of the parent process from being copied to the
subprocess.