Please enable JavaScript to view this site.

A-Shell Consolidated Reference

Revised/reviewed June 2020

xcall SUBMIT, pid, stdin, stdout, stderr, executable, {arg1, arg2, ...argn}

(Unix only) SUBMIT allows you to execute an arbitrary command (executable and arguments) as a child process of the current A-Shell process. It is similar to HOSTEX, but implemented using the lower level fork() / exec() sequence, rather than the higher level system() call used by HOSTEX. The lower level implementation provides some additional flexibility, which is mainly of use to SUBMIT.LIT, and thus is primarily of interest as an internal routine.

Parameters

Parameter

Type

I/O

Description

pid

Num

out

Returns the process id number (pid) of the child process created to run the command. (Note that such pids can be larger than 64K in most modern Unix implementation, thus B,2 is not a good choice.)

stdin

String

in

Must specify the filespec (AMOS-style or native) of a file containing the input to be forced to the process (aka the "control file"). This is typically similar to a CMD file, but may contain raw keyboard characters as well as commands, and should start with a LOG command.

stdout,
stderr

String

in

Must specify the filespecs of files to which the standard and error output of the process will be sent. To mimic the AMOS log file behavior, set them both to the same name (typically with an extension of LOG and a base name either matching the control file or the job name).

executable

String

 

Filespec of an executable which the child process will be forced to run. (In the case of SUBMIT.LIT, this is always "ashell", but could in theory be anything.) Normal operating system search path rules apply if the filespec doesn't specify a path.

arg1,
arg2,
...
argn

String

in

Optional arguments to the command specified in the executable parameter, not to be confused with the SUBMIT.LIT switches. Note that switches consisting of two parts, such as "-j JOBABC" must be specified as two separate arguments (i.e. "-j" and "JOBABC"). If a single switch part contains embedded spaces, it must be enclosed in quotes, i.e. "-i", """c:\vm test\miame.ini""". See the example below, and Command Line Switches for A-Shell switches.

 

Example

xcall SUBMIT, PID, "CMD:TEST.CTL", "TEST.LOG", "TEST.LOG", "ashell", "-i", "/vm/miame/miame.ini", "-j", "TSTJOB"

Comments

SUBMIT is used by SUBMIT.LIT, but only in the Unix environment, and only for certain combinations of switches. For example, the /NEXT and /AFTER switches do not result in SUBMIT calls, and those switches would be invalid arguments to XCALL SUBMIT. Similarly, the SUBMIT.LIT switches used for queries or displays are handled independently within SUBMIT.LIT. To examine the relationship between SUBMIT.LIT and SUBMIT, you can set the TRACE Option to log the subroutine operations within SUBMIT.LIT to the ASHLOG file.

Child processes launched via SUBMIT are generally dependent on the parent process to continue running for the duration of the child process. To launch a child/background process independent of the current process, use SUBMIT.LIT with the /NEXT: or /AFTER: switch, or set the SUBMIT2 system parameter.

See Also

The system parameter SBR option SUBMIT2 for related information.