Spawns a childprocess to execute a given command.
TIP: Shells that handle process suspension (e.g.,/bin/csh
) offer a more efficient way to get the same effect.
F77_Unformatted (UNIX only) If set, opens a pipe to the spawned process in a mode to do unformatted FORTRAN F77 input/output.
Noclisym (OpenVMS only) If set, prevents the spawned process from inheriting CLI symbols from its caller. Otherwise, the subprocess inherits all currently defined CLI symbols.
TIP: You may want to specify Noclisym to help prevent commands redefined by symbol assignments from affecting the spawned commands.
TIP: You may want to specify Nolognam to help prevent commands redefined by logical name assignments from affecting the spawned commands.
Noshell is useful when performing many spawned operations from a program and speed is a primary concern. Since no shell is present, wildcard characters are not expanded, and other tasks normally performed by the shell do not occur.
Notify (OpenVMS only) If set, broadcasts a message to
SYS$OUTPUT
when the subprocess completes or aborts. Otherwise, no message is broadcast. This keyword should not be set unless the Nowait keyword is also set.Nowait (OpenVMS only) If set, causes the calling process to continue executing in parallel with the subprocess. Otherwise, the calling process waits until the subprocess completes.
Pid A named variable for storing the process identification number of the child process.
Sh (UNIX only) If present and nonzero, forces the use of the Bourne shell.
Unit A named variable for storing the number of the file unit.
If present, causes SPAWN to create a child process in the usual manner, but instead of waiting for the specified command to finish, SPAWN attaches a bidirectional pipe between the child process and PV-WAVE. From the PV-WAVE session, the pipe appears as a logical file unit. The other end of the pipe is attached to the child process standard input and output.
NOTE: If the Unit keyword is used, the command parameter must also be present, and result is not allowed.
SHELL
environment variable. Under OpenVMS, the DCL command language interpreter is used.Once the child process is started, the PV-WAVE session can communicate with it using the normal input/output facilities. After the child process has done its task, the CLOSE procedure is used to delete the process and close the pipe.
Since SPAWN uses GET_LUN to allocate the file unit, FREE_LUN should be used to free the unit.
SPAWN,'ps -a'
.
NOTE: Also see the PV-WAVE GUI Application Developer's Guide