Lesson 5 The History Stack [ Using the 900 Series HP 3000: Fundamental Skills Module 1: Communicating with Yo ] MPE/iX 5.0 Documentation
Using the 900 Series HP 3000: Fundamental Skills Module 1: Communicating with Yo
Lesson 5 The History Stack
Lesson 5 presents reexecuting and editing commands in the history stack.
The history stack is a portion of the computer's memory where the
computer records your most recent commands. It keeps them there for you
to reuse or correct.
Having to reenter a complex command line could be tedious.
* The LISTREDO command displays the commands in the history stack.
* The DO command reexecutes commands in the history stack.
* The REDO command edits and reexecutes commands in the history
stack.
The DO command allows you to retrieve a complex command and reexecute it
without having to reenter it.
The REDO command allows you to retrieve a command, edit it, and reexecute
it without having to reenter the entire command.
NOTE In order to do the following exercises, you must start a new
session. If you are logged on, log off and then log back on again.
Then follow the next steps exactly.
BYEReturn
HELLO your logon identityReturn
There is a reason for having you log off and log back on. Logging off
clears the command line history stack. Logging back on starts you with
an empty history stack; otherwise, the history stack would be cluttered
with previous commands.
What is the command line history stack?
Each time you enter a command, your MPE/iX system saves that command in a
list called the command line history stack. You may hear it called the
redo stack.
In the command line history stack, each command is added at the bottom of
the list as it is entered:
* Only the 20 most recent commands are kept in the history stack.
(This number can be changed.)
* The LISTREDO command shows you the commands kept in the history
stack.
Enter these commands just the way they are shown here:
CHOWMMReturn
SHOWTIMEReturn
SHOWJOBReturn
CHOWMM produces an error message. SHOWTIME and SHOWJOB produce the
displays of the kind you have seen before.
Command history and the LISTREDO command
LISTREDO displays past commands.
Enter:
LISTREDOReturn
Here is how your screen looks:
________________________________________________________________________
| |
| |
| :LISTREDO |
| 1) CHOWMM |
| 2) SHOWTIME |
| 3) SHOWJOB |
| 4) LISTREDO |
| |
________________________________________________________________________
All of the commands you issued, including the LISTREDO command itself,
are stored in the history stack. They appear in the order you entered
them.
The DO command
If you want to reexecute a command in the history stack without editing,
use the DO command:
* Typing DOReturn reexecutes the most recent command.
* Typing DO N Return reexecutes command number N.
* Typing DO never appears in the command line history stack.
For example, reexecute the third command you that entered (SHOWJOB).
Enter:
DO 3Return
Did the SHOWJOB command execute?
Was it added to the history stack?
Enter:
LISTREDOReturn
How would you use DO to reexecute the SHOWTIME command?
Enter:
DO 2Return
Was it added to the history stack?
Enter:
LISTREDOReturn
History stack numbering
The history stack by default holds only the last 20 commands of your
current session. But the history stack never runs out of room. Instead,
it continues recording commands by number, dropping the oldest command to
make room for the newest command.
Suppose that the letters of the English alphabet (A through Z) were
commands. If you were to use all 26 commands and then execute LISTREDO,
you would see something like this:
________________________________________________________________________
| |
| |
| :LISTREDO |
| 8) H Commands A through G |
| 9) I (1 through 7) have "fallen" |
| 10) J out of the history stack. |
| 11) K They are no longer available |
| 12) L to REDO or DO. |
| 13) M |
| |
| |
| 14) N The history stack continues |
| 15) O recording commands in the |
| 16) P absolute order in which |
| 17) Q they were executed. |
| 18) R |
| |
| |
| 19) S Here the 8th command is |
| 20) T the "oldest" and the 27th |
| 21) U is the most recent. |
| 22) V |
| |
| |
| 23) W The 28th command will |
| 24) X "push" the 8th command out |
| 25) Y of the history stack. |
| 26) Z |
| |
| |
| 27) LISTREDO |
| |
________________________________________________________________________
Command history and REDO
The REDO command works like the DO command, but with one difference:
REDO allows you to edit a command in the command line history stack
before you reexecute it.
* Typing REDOReturn allows you to edit and reexecute the most recent
command.
* Typing REDO N Return allows you to edit and reexecute command
number N.
* The REDO command never appears in the command line history stack.
Enter :
LISTREDOReturn
You should see the sequence of commands you have issued.
To edit the command that was entered incorrectly (CHOWMM) enter:
REDO 1Return
Command 1 in your history stack is retrieved, ready for you to make
corrections to it, using the REDO line editing methods you are now
familiar with:
CHOWMM
RSReturn
SHOWMM
_____DReturn
SHOWM
_____IEReturn
SHOWME
Return
Try entering:
LISTREDOReturn
Notice that the commands you that have issued have stacked up, one after
the other.
HELLO never appears in the command
line history stack.
NOTE The DO and REDO commands work only with those commands still kept
in the history stack. If the history stack contains commands 8
through 27, attempting REDO 3 produces an error message:
INVALID NUMERIC INDEX INTO THE REDO STACK (CIERR 9073)
MPE/iX 5.0 Documentation