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.
Similarly to a Unix shell, EXEC presents the user with a simple text-based command line interface. EXEC prints a prompt string (the default prompt is
@), after which the user types a command indicating the operation he wishes the system to perform.
Commands are entered in the form:
(Some commands also allow the input of subcommands.)
Long commands can be continued to a second line by typing a hyphen (
-) at the end of the first line, pressing Enter, and continuing with command input on the new line.
EXEC then processes the command, possibly displaying output on the user's terminal. When command processing has been completed, EXEC displays a new prompt to indicate that it is ready for another command.
EXEC has several features that assist the user in entering commands.
? while entering a command will display a list of possible commands, arguments, or description of what argument is expected.
?lists all TOPS-20 commands.
?lists TOPS-20 commands beginning with the characters entered so far.
?lists or describes possible arguments at the current position.
During command entry, pressing Esc will complete partial commands and arguments and display guidewords.
Guidewords (also called “noise words”) are parenthesized words or phrases that EXEC inserts into the command text to describe the command or the arguments expected. Guidewords are only for documentation and are ignored during command processing. For example, entering “diEsc” at the EXEC prompt will cause EXEC to insert the following characters into the command text:
@diRECTORY (OF FILES)
… and wait for the user to specify what files he wants listed, or press Enter to list all files in the current directory.
Commands, arguments, and switches can be entered in abbreviated form — only typing enough characters to be distinguishable from alternatives. For some commands, etc., only one or two characters is sufficient.
Acceptable non-unique abbreviations have been defined for some commands:
Use the following control keys to edit command text before pressing Enter (except for Ctrl-H).
|Backspace||Delete last-typed character to the left.|
|Ctrl-R||Retype current command line.|
|Ctrl-U||Erase current command line.|
|Ctrl-W||Erase previous word.|
|Ctrl-H||Reprint erroneous command up to error.*|
* When EXEC detects an error in an entered command, it will display a “?” and possibly an error message. Pressing Ctrl-H will retype at the EXEC prompt the command text up to the location where EXEC detected the error, allowing the user to correct just the erroneous portion and reenter.
To enter subcommands, type a comma (
,) at the end of the command line before pressing Enter. EXEC will respond with the subcommand prompt (default
@@). Enter a subcommand and press Enter, repeating for as many subcommands as you wish to specify. Press Enter on a blank line to end subcommand input and EXEC will process the command with the specified subcommands.
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
CRLFto 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.
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
|SUBMIT|| 1. SYSTEM:BATCH.CMD
|PUSH|| 1. SYSTEM:COMAND.CMD
|LOGOUT|| 1. 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.
In principle, your LOGIN.CMD file should contain programs you want to run automatically when you log-in and job-wide customizations (DEFINE, SET LOCATION), while your COMAND.CMD should contain local EXEC customizations that you want applied every time EXEC starts for both LOGIN and PUSH (SET DEFAULT, SET PROGRAM, SET PROMPT or PCL declarations).