HPlogo MPE/iX Commands Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 6 Command Definitions P-R

REDO

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Allows the user to edit and reexecute any command still retained in the command line history stack. (Native Mode)

Syntax

REDO [[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

Specifies the command to execute. The command may be specified by its relative or absolute order in the command line history stack, or by name (as a string). The default is -1, the most recent command.

The following Table 6-2 “Re-execute Directives for the REDO Command” illustrates the result of using various forms of the cmdid parameter.

Table 6-2 Re-execute Directives for the REDO Command

cmdidExecutes
(omitted)Previous command (same as REDO -1).
-nThe nth command before the most recent one. The n represents a number in the command line stack relative to the most recent command, which is -1.
mCommand number m in the command line stack. The number m is absolute (not relative).
stringThe most recent command beginning with string.

 

MPE/iX detects an error if you specify a cmdid that cannot be found in the history stack.

editstring

A string specifying the first (of one or more) edit(s) to be performed on cmdid before it is displayed on the standard listing device ($STDLIST).

When the (edited) command line is displayed, you may edit the line interactively. REDO displays the command line and accepts further edits repeatedly, until you signal completion by entering a Return only. At this point, the CI executes the edited version of the command.

If you omit editstring, then you are given the opportunity to edit the command line interactively, after which the command is reexecuted.

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 edit string must be surrounded by quotation marks (" ") if it contains any scanner/parser delimiters such as: , ; " ' [ ] or = or spaces.

Operation Notes

REDO executes the command specified as cmdid. The user may specify an optional editstring that edits the command before it is reexecuted. This command is a companion to the MPE/iX DO command. Unlike the DO command, the REDO command does permit interactive editing.

If editstring is specified, the edit is performed on cmdid before the command is presented for interactive editing. If editstring is omitted, then editing is interactive.

In either case, the (edited) line is echoed to $STDLIST before it is reexecuted. At this point, you may edit the line interactively. The interactive (editing) mode, remains available to you until you press only Return.

Both cmdid and editstring must be surrounded by either single or double quotation marks if they contain any delimiters such as , ; " " [, ], =, or a space.

The editing directives used in editstring are defined in Table 3-5 “Editing Directives for the DO Command”.

.

Table 6-3 Editing Directives for the REDO Command

DirectiveEffect
iINSERT. If text follows the i, the text following i is inserted in the current line at the position after the i.
rREPLACE. 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.
dDELETE. Deletes a character from the current line for each specified in the edit line. Note that "d d" does not specify a range but simply deletes one character from the position above each d. Multiple d's may be followed by an insert or replace operation.
dwDELETE WORD. Deletes a word starting at the letter d. A word is defined as all characters except a space, comma, or semicolon. If you place the d directly beneath a word delimiter, then the word and the delimiter characters are deleted. If no word exists on the command line, no delete occurs. You may follow this directive with other edits.
ddelimDELETE TO DELIMITER. Deletes all characters starting at the position of the d and ending at, but not including, the specified delimiter. If delim is not found, no delete occurs. You may follow this directive with other edits.
d>DELETE TO EOL. Deletes to the end of the current line from the position specified by d>. It may be followed by an INSERT or REPLACE operation.
^UPSHIFT. Upshifts the character positioned at the ^. You may specify multiple ^ characters to upshift a series of characters. Or, you may type multiple ^ characters, followed by spaces, then followed by more ^'s to upshift some characters while skipping others. You may follow this directive with other edits.
^wUPSHIFT WORD. Upshifts the word starting at the position specified by ^. A word is defined as all characters except a space, comma, or semicolon. If you place the ^ directly beneath a word delimiter, the delimiter is skipped and only the word is upshifted. If no word exists on the command line, no upshift occurs. You may follow this directive with other edits.
^delimUPSHIFT TO DELIMITER. Upshifts all characters starting at the position specified by the ^ and ending at, but not including, the specified delimiter. If delim is not found, no upshift occurs. You may follow this directive with other edits.
^>UPSHIFT TO EOL. Upshifts all characters starting from the position specified by the ^ to the end of the current line. You may follow this directive with other edits.
vDOWNSHIFT. Downshifts the character positioned at the v. You may specify multiple v's to downshift a series of characters. Or, you may type multiple v's, followed by spaces, then followed by more v's to downshift some characters while skipping others. You may follow this directive with other edits.
vwDOWNSHIFT WORD. Downshifts the word starting at the position specified by v. A word is defined as all characters except a space, comma, or semicolon. If you place the v directly beneath a word delimiter, the delimiter is skipped and only the word is downshifted. If no word exists on the command line, no downshift occurs. You may follow this directive with other edits.
vdelimDOWNSHIFT TO DELIMITER. Downshifts all characters starting at the position of the v and ending at, but not including, the specified delimiter. If delim is not found, no downshift occurs. You may follow this directive with other edits.
v>DOWNSHIFT TO EOL. Downshifts all characters starting from the position specified by the v to the end of the current line. You may follow this directive with other edits.
>textAPPEND. The > followed by text appends the text to the end of the current line. If > is positioned beyond the end of the current line, then a replacement is performed instead.
>dDELETE FROM EOL. 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.
>dwDELETE WORD FROM EOL. Deletes the last word in the command line. To find the last word, trailing word delimiters are skipped. If no word exists in the command line, then none is deleted. If you follow >dw with additional editing directives, each edit is performed recursively. That is, the first edit is performed (updating the current EOL), then the next edit is performed (again updating the current EOL), and so on.
>ddelimDELETE TO DELIMITER FROM EOL. Starting at the end of the current line, deletes all characters right-to-left up to, but not including, delim. If the delimiter is not found, no delete occurs. If you follow this directive with additional editing directives, each edit is performed recursively. That is, the first edit is performed (updating the current EOL), then the next edit is performed (again updating the current EOL), and so on.
>^UPSHIFT FROM EOL. Upshifts the character at the current EOL. You may specify multiple ^'s to upshift a series of characters (read right-to-left) from the EOL. Also, you may follow this directive with other edits.
>^wUPSHIFT WORD FROM EOL. Upshifts the last word in the command line. You may follow this directive with other edits.
>^delimUPSHIFT TO DELIMITER FROM EOL. Starting at the end of the current line, upshifts all characters right-to-left up to, but not including, delim. If the delimiter is not found, no upshift occurs. You may follow this directive with other edits.
>vDOWNSHIFT FROM EOL. Downshifts the character at the current EOL. You may specify multiple v's to downshift a series of characters (read right-to-left) from the EOL, and you may follow this directive with other edits.
>vwDOWNSHIFT WORD FROM EOL. Downshifts the last word in the command line. You may follow this directive with other edits.
>vdelimDOWNSHIFT TO DELIMITER FROM EOL. Starting at the end of the current line, downshifts all characters right-to-left up to, but not including, delim. If the delimiter is not found, no downshift occurs. You may follow this directive with other edits.
>rtextREPLACE. 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.
cCHANGE. 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.
uUNDO. 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. UNDO makes sense only if you have a line on which you have performed some editing that can be "undone."
otherSimple replacement. Any other character (not i, r, d, d>, >, >d, c, or u) causes that character to be replaced in the current line at the position indicated by the character. In fact, simple replacement also 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.

 

Editing Samples

The Table 6-4 “REDO Editing Samples” shows examples of using the REDO command.

Table 6-4 REDO Editing Samples

EditAction
uFirst occurrence undoes the previous edits. The u must be in column one.
uSecond occurrence undoes all edits on the current line. The u must be in column one.
rxyzReplaces the current text with xyz starting at the position of r.
xyzReplaces the current text with xyz starting at the position of x.
ixyzInserts xyz into the current line, starting at the position immediately before the i.
dddDeletes three characters, one above each d.
d xyzDeletes a single character above the d, skips one space, then replaces the current text with xyz starting at the position of x.
ddixyzDeletes two characters, then inserts xyz in the current line in the position before the i.
d dDeletes 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>xyzDeletes 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.
>xyzAppends xyz to the end of the current line.
>ddxyzDeletes the last two characters from the end of the current line and then appends xyz to the end of the line.
>rxyzReplaces the last three characters in the current line with xyz.
>ixyzAppends 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/defChanges all occurrences of ab to def, starting at c.
c"ab"Deletes all occurrences of "ab" starting at c.
cxyzReplaces 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.
^wixUpshifts the word above the ^ and inserts an "x" at the end of the word it just upshifted.
v/abcStarting at the position of v, downshifts all characters up to, but not including, the "/", then replaces the "/" and the next two characters with "abc".
>dw^.dwDeletes the last word in the current line, recalculates the EOL, then upshifts all characters up to, but not including, the dot (.), then deletes the word to the left of the characters that were upshifted.

 

Use

This command is available in a session or in BREAK. It is not available in a job or from a program. Pressing Break aborts the execution of this command.

Examples

The following are examples of editing options for the REDO command:

REDO PAS

Edits the most recent command beginning with the string PAS.

REDO 10

Edits command number 10 (absolute) on the command history stack.

REDO -2

Edits the second-to-last command on the stack (one command before the most recent).

Related Information

Commands

DO, LISTREDO

Manuals

Using the HP 3000 Series 900: Advanced Skills

Feedback to webmaster