User Tools

Site Tools


tutorials:exec

This is an old revision of the document!


EXEC is the TOPS-20 command parser. It plays a role within TOPS-20 similar to shell programs in Unix systems. However, the range of system functions implemented as EXEC build-in commands is much more extensive what is usually provided by Unix shells.

Using EXEC

[Put general information on using EXEC here. (Completion, guide words, command line editing, help …)]

Command Files

A TOPS-20 command file is text file containing a sequence of TOPS-20 commands that are to be executed in a batch. The default file type is “.CMD”. You can run the command file “MYCMDS.CMD” in your current directory with the command:

@TAKE (COMMANDS FROM) MYCMDS

TOPS-20 will read the commands in MYCMDS.CMD and execute them in order, displaying command output on your terminal, then display the following message to indicate the end of command file processing:

  End of MYCMDS.CMD.1

You can suppress the display of the end-of-processing message by putting the command TAKE with no arguments on the last line of the command file.

EXEC requires all command file lines to end with carriage return+line feed control sequence (CRLF) (usually accomplished by pressing the Enter key at the end of a line when editing). However, some TOPS-20 editors do not automatically append CRLF to the last line of a file, which can cause EXEC to ignore the final command of a command file. If you use such an editor (Emacs, TECO, …), make sure to press Enter at the end of the last line.

Automatic commands

EXEC will automatically execute certain command files (if they exist) when processing the following commands:

(Command files are executed in the indicated order. Files not in SYSTEM: are searched for in the user's log-in directory. Non-existent files are skipped.)

TOPS-20 Command Automatic command files
LOGIN 1. SYSTEM:LOGIN.CMD
2. LOGIN.CMD
3. SYSTEM:COMAND.CMD
4. COMAND.CMD
SUBMIT 1. SYSTEM:BATCH.CMD
2. BATCH.CMD
3. SYSTEM:COMAND.CMD
4. COMAND.CMD
PUSH 1. SYSTEM:COMAND.CMD
2. COMAND.CMD
LOGOUT 1. LOGOUT.CMD
2. SYSTEM:LOGOUT.CMD

When EXEC executes multiple command files, commands in earlier command files may be overridden by commands in later files. For example, during log-in a SET PROMPTS command in a user's LOGIN.CMD may be overridden in SYSTEM:COMAND.CMD since it is executed later in the sequence. This may be the case if EXEC seems to be ignoring commands in your LOGIN.CMD. Try moving such commands to your COMAND.CMD file, which is executed last in the log-in sequence and will override any conflicting commands in SYSTEM:COMAND.CMD.

tutorials/exec.1647224877.txt.gz · Last modified: 2022/03/14 02:27 by papa