Another command line interpreter for RSX11M V3.2 systems that support spawn and stop directives M. Stewart Western Electric Northern Illinois Works 4513 Western Ave. Lisle, Illinois A command line interpreter was written to provide a very flexible DEC style command structure. The interpreter supports three types of commands which we will designate as direct, user, and system commands. The direct commands are a fixed set of commands that spawn an appropriate RSX utility to accomplish the desired function. The direct commands are: APP[END], CLO[SE], COP[Y], DEL[ETE], DIR[ECTORY], FRE[E], PRO[TECT], PUR[GE], REN[AME], TRU[NCATE], and UIC. These commands utilize default parameters as well as flexible syntactical structure. There are several different classes of direct commands that will be discussed. The first, involves commands that have a source and destination filespec as elements of the command. APP[END], COP[Y], and REN[AME] are commands requiring both a source and destination file specification. These commands can be done with several formats as indicated by the following examples (system responses are indicated by lower case letters). REN from:JUNK.DAT to:NEW.DAT COP NEW.DAT to:MORE.DAT COP MORE.DAT=NEW.DAT COP NEW.DAT MORE.DAT The reader should note that the last three copy commands produce equivalent results. In particular the last two commands show the use of "=" or " " as the file specification separator which results in the reversal of the source and destination files. CLO[SE], DEL[ETE], PRO[TECT], and TYP[E] are another class of direct direct that require only a single file specification. For this class the specification can be omitted from the command, and if it is omitted, then the user will be prompted for the file. The following are examples of this class of commands. TYPE DK0:[200,200]RSXMC.MAC PRO file:MYFILE.CMD/GR:R Command line interpreter. Page 2 CLOSE ONE.MAC The CLOSE command is used to unlock locked files (i.e., Close them properly if possible). DIR[ECTORY], PUR[GE] and TRU[NCATE] are a class of direct commands that have a file specification as an optional argument. For this class of commands if the filespec does not contain a filename, then the command is done for all files. The DIR[ECTORY] command also has a special switch in addition to the standard switches passed on to PIP. The sort switch (/SO) can be included to spawn SRD to sort the directory before the information is displayed by PIP. The user can also use wild character directory searches using the ?; however, the syntax for this kind of directory command is messy since SRD is the only task spawned. For example if the user wanted all files starting with a G, then the command DIR G?* would be used. In other words anytime a wild card is used with other characters in the name or type fields of the filespec it must also contain at least one wild character. The direct command FRE[E] reports the free blocks on the device specified. If no device is specified, the default is SY0:. Finally, the direct command UIC is used to set the UIC or list the current UIC. The command sets the UIC if one is passed as an argument on the command line, otherwise the current UIC is written on the user terminal. One additional note before considering the user and system commands. COP[Y] and TYP[E] commands are DECNET compatible since CLI can spawn NFT if a node name is included in the filespec. CLI supports both forms of node name specifications (terminated with "_" or "::"), so PHASE II and PHASE III NFT transfers will work without problems. CLI attempts to be somewhat forgiving in what is acceptable syntax. For example, the terminating ] for commands that specify the UIC as the last element on a line will be filled in if needed. As a final note concerning the direct commands, the user can terminate commands with a to cause the command line interpreter not to stop for the tasks it spawns. In this way CLI is avaliable to execute more commands. This method should be used with care for obvious reasons. The way user and system commands are handled by the command line interpreter provides a powerful method of incorporating processes as supplements to the direct commands. User and system commands are incorporated into CLI in a fairly simple manner. If CLI is given a line that is not a direct command, it looks for a file with the command name with an type of PRO. CLI then spawns MCR with the command line @commandname.pro commandxtra (where commandxtra is the information following the command name). If no such file exists, then CLI looks on LB:[1,2] for the system process. If no such process exists then CLI indicates no such process. Command line interpreter. Page 3 Two example user or system commands are appended to the text to show how the indirect command handler files are used to create the special command. The only drawback to all this is the overhead created by having ...AT. involved in production of processes; however, it sure is flexible. The first example is a process that will display the processes associated with the current UIC and then all the system processes. The second example is a general procedure for compiling a FORTRAN or MACRO source program. ********************** SHOW.PRO **************************** .ENABLE SUBSTITUTION .IF P1 EQ "" .SETS UIC .IF P1 EQ "" .GOTO 1 .PARSE P1 "," A B .IF B EQ "" ; Syntax error .IF B EQ "" .GOTO 999 .TEST P1 .SETS C P1[1:1] .SETS D P1[:] .SETS A "" .SETS B "" .IF C NE "[" .SETS A "[" .IF D NE "]" .SETS B "]" .SETS UIC A+P1+B .1: .PARSE