HP 3000 Manuals

DO [ MPE/iX Commands Reference Manual Volume I ] MPE/iX 5.0 Documentation


MPE/iX Commands Reference Manual Volume I

DO 

Allows the user to reexecute any command still retained in the command
line history stack.  It also permits the user to edit the command before
reexecuting it, but without having to use the interactive mode of the
REDO command.  (Native Mode)

Syntax 

DO [CMD=cmdid][;EDIT=editstring]


NOTE This command follows the optional MPE/iX command line syntax. Refer to "Optional Format for MPE/iX Commands" at the beginning of this chapter.
Parameters cmdid The command to reexecute. The command may be specified by its relative or absolute order in the command line history stack, or by name (as a string), in whole or in part. The default is -1, the most recent command. MPE/iX detects an error if cmdid does not exist in the command line history stack. Table 2-8 defines the DO command directives. Table 2-8. DO Command - Reexecute Directives --------------------------------------------------------------------------------------------- | | | | cmdid | Executes | | | | - - | | | | (omitted) | Previous command. | | | | - - | | | | -n | The nth command before the most recent one, where n is a number in | | | the command line stack relative to the most recent command, which is | | | -1. | | | | - - | | | | m | Command number m in the command line stack. The number m is absolute | | | (not relative). | | | | - - | | | | string | The most recent command beginning with string. | | | | --------------------------------------------------------------------------------------------- editstring String specifying the edit to be performed on cmdid before it is reexecuted. If you omit editstring, the command is reexecuted immediately, with no editing performed. If you specify editstring, it must appear, character for character, and space for space, exactly as it would if you were using the REDO command in interactive mode. The editing directives used in editstring are defined in table 2-9. Table 2-9. DO Command - Editing Directives ------------------------------------------------------------- | | | | Directive | Effect | | | | ------------------------------------------------------------- | | | | i | INSERT. If text follows the i, the text | | | following i is inserted in the current | | | line at the position after the i. | | | | - - | | | | r | REPLACE. If text follows the r, the text | | | following r replaces the same number of | | | characters in the current line, beginning | | | at the position of r. | | | | - - | | | | d | DELETE. Deletes a character from the | | | current line for each specified d in the | | | edit line. Note that "d d" does not | | | specify a range, but deletes one character | | | from the position above each d. Multiple | | | d's may be followed by an insert or | | | replace operation. | | | | - - | | | | d> | DELETE. Deletes to the end of the current | | | line from the position specified by d>. | | | It may be followed by an INSERT or REPLACE | | | operation. | | | | - - | | | | > | APPEND. The > followed by text appends the | | | text to the end of the current line. If > | | | is positioned beyond the end of the | | | current line, a replacement is done. | | | | - - | | | | >d | DELETE. Deletes from the end of the | | | current line, right-to-left. Multiple d's | | | may be specified after >, as well as | | | INSERT and REPLACE strings. | | | | - - | | | | >r | REPLACE. Replaces characters at the end of | | | the command line. The replacement is done | | | so that the last (rightmost) character of | | | the replacement string is at the end of | | | the line. | | | | | c | CHANGE. Changes all occurrences of one | | | string to another in the current line when | | | the search string and replace string are | | | properly delimited. A proper delimiter is | | | a nonalphabetic character such as ', " or, | | | /. The substitution is specified as: | | | c<delim> search-string<delim> | | | [replace-string [<delim>]]. Omitting the | | | replace-string causes occurrences of | | | search-string to be deleted, with no | | | substitution. | | | | - - | | | | u | UNDO. A single u in column one cancels the | | | most recent edit of the current line. | | | Using the UNDO command twice in a row | | | cancels all edits for the current line and | | | reestablishes the original, unedited line. | | | If u is placed anywhere other than column | | | one of the current line, then a simple | | | replacement is performed. | | | | - - | | | | other | Simple replacement. Any character except | | | i, r, d, d>, >, >d, c, or u replaces that | | | character in the current line at the | | | position indicated by the character. | | | Simple replacement occurs for the editing | | | characters i, r, c, or > if they are not | | | followed by text; or if > appears at or | | | beyond the current end of line. | | | | ------------------------------------------------------------- Operation Notes Reexecutes the command specified by cmdid. The user may specify an optional edit string to edit the command before it is reexecuted. This command is a companion to the enhanced MPE/iX version of the REDO command. Unlike REDO, the DO command does not permit interactive editing. If editstring is specified, the edit is performed on cmdid before the command is reexecuted. The editstring must appear exactly as it would if you were using the REDO command. Both cmdid and editstring must be surrounded by quotation marks (either " or ') if they contain any delimiters such as ; " ' [, ], =, or a space. Use This command is available in a session or in BREAK. It is not available in a job or from a program. Pressing Break terminates recursive command executions from the history/redo stack. Editing Samples Practical uses of the editing commands listed above are shown in table 2-10. Table 2-10. Editing Samples for the DO Command ------------------------------------------------------------- | | | | Edit | Action | | | | ------------------------------------------------------------- | | | | u | First occurrence undoes the previous | | | edits. The u must be in column one. | | | | - - | | | | u | Second occurrence undoes all edits on the | | | current line. The u must be in column | | | one. | | | | - - | | | | rxyz | Replaces the current text with xyz | | | starting at the position of r. | | | | - - | | | | xyz | Replaces the current text with xyz | | | starting at the position of x. | | | | - - | | | | ixyz | Inserts xyz into the current line, | | | starting at the position immediately | | | before the i. | | | | - - | | | | ddd | Deletes three characters, one above each | | | d. | | | | - - | | | | d xyz | Deletes a single character above the d, | | | skips one space, then replaces the current | | | text with xyz starting at the position of | | | x. | | | | - - | | | | ddixyz | Deletes two characters, then inserts xyz | | | in the current line in the position before | | | the i. | | | | - - | | | | d d | Deletes one character above the first d, | | | skips two spaces and deletes a second | | | character above the second d. It does not | | | delete a range of characters. | | | | - - | | | | d d>xyz | Deletes a single character above the first | | | d, skips two spaces and deletes to the end | | | of the line beginning at the second d, and | | | then appends xyz to the end of line. | | | | - - | | | | >xyz | Appends xyz to the end of the current | | | line. | | | | - - | | | | >ddxyz | Deletes the last two characters from the | | | end of the current line and then appends | | | xyz to the end of the line. | | | | | >rxyz | Replaces the last three characters in the | | | current line with xyz. | | | | - - | | | | >ixyz | Appends xyz to the end of the line. In | | | this case, the i command is superfluous, | | | because > accomplishes the same result. | | | Using >xyz would be sufficient. | | | | - - | | | | c/ab/def | Changes all occurrences of ab to def, | | | starting at c. | | | | - - | | | | c"ab" | Deletes all occurrences of "ab" starting | | | at c. | | | | - - | | | | cxyz | Replace the current text with cxyz, | | | starting at c. Because delimiters have | | | been specified (as they were in the | | | previous two examples), this is a simple | | | replacement. | | | | ------------------------------------------------------------- Examples DO PAS Reexecutes the most recent command beginning with the string PAS. DO 10 Reexecutes command number 10 (absolute) on the command history stack. DO -2 Reexecutes the second-to-last command on the stack (one command before the most recent). DO -2, c/5A/5B Change all occurrences of 5A to 5B in the command preceding the most recent one before reexecuting it. The default is -1. do ,c/5A/5B Change all occurrences of 5A to 5B in the most recent command before reexecuting it. DO RUN, ">;DEBUG" Append ;DEBUG to the most recent RUN command and then reexecute it. DO 'RUN MYP', Find the most recent command beginning with RUN MYP '>;LIB=G' and append ;LIB=G before reexecuting it. Related Information Commands REDO, LISTREDO Manuals Using the 900 Series HP 3000: Advanced Skills (31126A Opt. 002)


MPE/iX 5.0 Documentation