Users Guide for MPEKEY MPEKEY was written to reduce the number of key strokes required to execute commands that were previously entered. It accomplishes this task by providing easy access to previous commands via control keys and provides functionality for managing, initializing and executing commands in a command stack which reduces key strokes and improves productivity. This program will be beneficial to programmers, operators and other HP/3000 users who utilize the MPE/iX command interpreter to perform their work. Benefits: Reduces key strokes to re-execute commands Reduces errors associated with retyping commands Eliminates having to type DO and REDO to re-execute commands Default command stack eliminates typing often used commands Features: Commands can be executed via command numbers A list or range of commands can be executed with one command Previous and next commands can be executed with control keys The command stack can be displayed in sequence or reverse order A default set of commands can be loaded upon start up The MPEKEY control commands can be remapped to other keys The command stack can be saved and reloaded in another session All commands starting with specific characters can be listed How it Works MPEKEY runs on top of the command interpreter and prompts for commands. As commands are entered, they are placed in a command stack and passed to the HPCICOMMAND intrinsic to execute. When MPEKEY recognizes its own commands via control characters, it performs the appropriate operation and then prompts for more input. Since MPEKEY sees the command before the command interpreter, it can add additional functionality to the command interpreter. The capability to execute commands via command numbers is just one of the enhancements that the user will perceive as being added to the command interpreter. The command stack managed by MPEKEY is not the same stack managed by the command interpreter. Data Flow User | MPEKEY --> HPCICOMMAND --> SubProcess | Command Interpreter | Session Requesting Help The help subsystem displays the MPEKEY control commands and a short description of each command. To request help, enter the ? character before entering other characters. If the ? character is not the first character entered then help will not be displayed. Example help display: ************* MPEKEY Command List *************** Control P -> Display previous command Control N -> Display next command Control L -> Display command stack Control D -> Display command stack in reverse order Control B -> Display matching commands in stack Control C -> Change current command and execute Control E -> Disable MPEKEY Up Arrow -> Display previous command Down Arrow -> Display next command Cmd Nbr,Cmd Nbr -> Execute list of commands Cmd Nbr/Cmd Nbr -> Execute range of commands ACT -> Display suspended processes ACT Pin Number -> Activate suspended process KILL Pin Number -> Remove suspended process DO cmdid -> Execute last command matching cmdid REDO cmdid -> Modify and execute last command matching cmdid Command Stack The command stack will retain a maximum of 500 commands. Each command can be 512 characters in length. Commands are assigned a unique number when placed in the stack and the number can be utilized to reference a specific command. When command numbers greater than five hundred are entered, the oldest command will be removed to make room for the most recent command entered. Commands that are loaded from a command file will be considered locked and will never be removed from the stack. This allows a user to always have access to commands that they use often. The command numbers assigned to the locked commands will not be reassigned. In the following example, the first command to be removed from the stack will be command number four. The first three commands are locked and will retain their position and command numbers. Example Command Stack: 1 [listf vis@.source,2] (Locked) 2 [showme ] (Locked) 3 [compile vista ] (Locked) 4 [edit vista ] 5 [compile vista1 ] 6 [nbspool ] 7 [showjob ] 8 [showproc ] As commands are entered, they are written to a temporary file named MPEKEYX. If you abort the MPEKEY program and then reexecute it (without specifying a command file), commands in the temporary file (MPEKEYX) will be automatically loaded into the command stack. This provides the capability to abort subprograms executed by MPEKEY without having to worry about losing your command stack. When you terminate MPEKEY with the exit control characters (Ctrl E) the temporary file MPEKEYX will be purged. Listing Command Stack The contents of the command stack can be listed by pressing the control characters (Ctrl L). The commands will be displayed starting from the bottom of the stack. The oldest command will be listed first followed by other commands entered until the most recent command entered is displayed. Each command listed will is assigned a command number. You can utilize the command number to execute a specific command, a list of commands or a range of commands. To list the command stack in reverse order enter the control sequence (Ctrl D). The most recent commands entered will be displayed first. To terminate the display of commands, enter the control sequence (Ctrl Y). This will stop listing commands in the command stack. When listing commands, escape characters will be converted to the period character. This will prevent escape sequences from executing when displayed. Listing Commands That Start With The Same Characters When you have a need to list only commands that start with certain characters, the command Display Matching Commands can be used. The control characters to perform this function are Ctrl B. Example Command Stack ----------------------- 1 [listf vis@.source,2] 2 [showme ] 3 [compile vista ] 4 [edit vista ] 5 [compile vista1 ] 6 [nbspool ] 7 [showjob ] 8 [showproc ] Assuming your command stack contains the previous commands, to view all commands that start with "sh", enter sh and press Ctrl B. The following lines will be displayed. 7 [showjob ] 8 [showproc ] Locating Previous Command The previous command within the stack can be accessed by pressing the control keys (Ctrl P). The previous command will be displayed. To execute the command press return. You can press Ctrl P continuously to traverse the command stack in reverse order. The terminal will beep when you press Ctrl P and you are viewing the first command in the stack. To modify and then execute the current command displayed press the control keys Ctrl C. Locating Next Command The next command within the stack can be accessed by pressing the control keys (Ctrl N). The next command will be displayed. To execute the command press return. You can press Ctrl N continuously to traverse the command stack in forward order. A blank command line will be displayed when you have reached the top of the command stack. To modify and then execute the current command displayed press the control keys Ctrl C. Modifying Current Command The current command can be modified and then executed by pressing the control keys Ctrl C. The command will be displayed and you will be prompted for changes. When prompted for input you will be in modify mode. Modify mode works similar to the REDO command. Specify the characters 'r' for replace, 'd' for delete and 'i' for insert. After entering command changes, press the return key to process the command. Executing Commands by Command Number Since MPE commands can not start with numeric digits it was decided to provide the capability re-execute commands via command numbers. When MPEKEY recognizes a numeric number as a command, it will retrieve the associated command from the command stack and execute the command. This reduces the typing required to execute a command that was previously entered. To execute the fourth command in the command stack enter the number four and press return. MPEKEY will retrieve the command that was assigned number four and execute it. In the following displayed command stack, the "edit vista" command will be executed: Command Stack: 1 [listf vis@.source,2] 2 [showme ] 3 [compile vista ] 4 [edit vista ] 5 [compile vista1 ] Executing a List of Commands A list of commands can be executed by specifying each command number separated by a comma. Example to execute commands five and six and nine: 5,6,9 Each command will be displayed prior to executing the command. Executing a Range of Commands A range of commands can be executed by specifying two command numbers separated by the slash character. Example to execute commands five through nine: 5/9 Each command will be displayed prior to executing the command. DO Command The DO command is available to execute a command in the stack that matches a command string. If you specify "ru" with the DO command, then MPEKEY will search the command stack starting with the last command entered for a matching command that starts with the letters "ru". If a match is found then the command will be executed. If you enter the DO command without specifying a command string, then the last command entered will be executed. Example: Do ru REDO Command The REDO command is similar to the DO command. The major difference is that the REDO command allows you to change the command prior to executing it. If you specify "ru" with the REDO command, then MPEKEY will search the command stack starting with the last command entered for a matching command that starts with the letters "ru". If a match is found then the command will be displayed and you will have an opportunity to make changes to the command. Press the return key to accept the changes and execute the command. If you enter the REDO command without specifying a command string, then the last command entered will be processed. When you changing a command with REDO, the MPE REDO replacement characters are supported. The letter 'R' represents replace, 'I' represents insert and 'D' represents delete. Example: REDO ru Loading Initial Commands Your command stack can be initialized upon start up of MPEKEY. This will allow you to always have certain commands loaded on your stack without having to type them in. When you load a command stack, the commands loaded will be considered locked. Should the command stack become full, MPEKEY will never overwrite the locked commands. This makes it possible to retain commands at specific locations within the stack. To build a list of commands, you should create a text file and then add them to the text file. When you start MPEKEY specify the text file with the -c option of MPEKEY. To load command stack, specify -c option and command file name Example: MPEKEY -cMYCMDS Save Command Stack Upon Exit Your command stack can be saved in an MPE file when you exit MPEKEY. This will allow you to save your current work should you decide to reenter MPEKEY and you want to utilize commands entered in another session. When you exit MPEKEY with the exit control keys and you specified the save option upon startup, MPEKEY will open the save filename and write the command stack. To save command stack, specify the -s option and save file name Example: MPEKEY -sSAVEFILE Remapping MPEKEY Commands Remapping commands allows you to specify operations MPEKEY is to perform when specific keys or control keys are pressed. A remap file contains control records and corresponding terminal keys or control keys. When a terminal key is pressed, MPEKEY will look up the key to determine if a specific operation is to be performed. The default value for each command is defined within the help subsystem. To remap the commands, built a text file and enter the command to remap and its corresponding control key. Control keys can be specified by entering the terminal character or a decimal value for a control key. In the following example $LIST-ASCENDING is assigned a value of 12. The 12 represents Ctrl L as defined in the ASCII table. Example remap file $PREVIOUS , $NEXT . $MODIFY 3 $EXIT 5 $HELP ? $LIST-ASCENDING 12 $LIST-DESCENDING 4 $MATCHING 2 In the previous remap file example, the previous command will be accessed via the comma character and the next command will be accessed via the period character. To remap MPEKEY commands specify -r option and remap file name Example: MPEKEY -rMYKEYS Breaking out of MPEKEY You can enter the colon character to temporarily break the MPEKEY program. This is useful when you are on a remote system running MPEKEY and want to return to a local system. Type the RESUME command to reactivate MPEKEY.