UniVerse keeps a 'history' of all the commands you have entered at the UniVerse command prompt. To demonstrate it, it is helpful to first enter a few commands. Try the following:
DISPLAY This is my first command
DISPLAY This is my second command
DISPLAY This is my third command
(The DISPLAY
command is explained above: see The Command Prompt above.)
To see you command history, enter .L
, which will display a list something like this:
03 DISPLAY This is my first command
02 DISPLAY This is my second command
01 DISPLAY This is my third command
This is called your 'command stack', and all the commands to manipulate it, like the ,L
command above, begin with a dot.
You can repeat your last command by entering .X
, or indeed any command by entering .Xn
, where n is the commands position in the stack, the most recent command always being 1. For instance, to repeat the command DISPLAY This is my second command
, enter .X2
. Try it.
If you now enter .L
again, you will see:
04 DISPLAY This is my first command
03 DISPLAY This is my second command
02 DISPLAY This is my third command
01 DISPLAY This is my second command
Notice that when you repeated the second command, it became the most recent command, and so appeared once more at position 1 in the stack. This is how the stack generally behaves: as you enter new commands, the older commands are each gradually shuffled down the command stack. Only when you enter .X
does it not generate a new entry in the command stack, because you are merely repeating the last command, so UniVerse decides to ignore it.
Take care. After a while you will find yourself 'remembering' where the commands will be and able to enter .X3
to reexecute the command you issued three commands ago, but to begin with always enter .L
to list the commands before reexecuting any but your last command: many an overconfident developer has deleted the source of the program he is working on, or cleared a file of carefully loaded data, by guessing the position of the command he wanted in the stack incorrectly.
You can delete the most recent entry in the stack by entering .D
, or indeed delete any entry by entering ,Dn
where n is the entry's number. Try entering .D3
to delete entry three, and then .L
to redisplay the stack:
03 DISPLAY This is my first command
02 DISPLAY This is my third command
01 DISPLAY This is my second command
To 'recall' an older command to the head of the stack, enter .Rn
, where n is again the number of the stack entry to recall. Try recalling entry 2 with .R2
, and relisting the stack with .L
:
03 DISPLAY This is my first command
02 DISPLAY This is my third command
01 DISPLAY This is my second command
02 DISPLAY This is my third command
Like .X
, .R
brings an old command to the top of the stack: but it doesn't run it again. You would most often do this because you wished to change the command before running it again. To change the most recent command in the stack, enter .C/oldstring/newstring
. For instance, you could change the word 'third' to '3rd' by entering .C/third/3rd
. Try it, and redisplay the stack with .L
:
03 DISPLAY This is my first command
02 DISPLAY This is my third command
01 DISPLAY This is my second command
02 DISPLAY This is my 3rd command
In principle, you could change any entry by using .Cn
in place of .C
to indicate it's number, but in practice its safer to use .Rn
first to recall the entry, and then .C
.
If the command you wish to change contains the '/' character, then you can use a different delimiter in your change command: the command .C!third!3rd
would have had exactly the same effect as the one you used above. In fact, you can use any of the following characters: !@#$%&*/\:=+-?(){}[]`'.,|, so you can generally find one which doesn't appear in your command.
If the same string appears more than once in your command, and you wish to change all the occurences in one go, append /G
: the 'G' standing for 'global'. For instance, type .C/m/!/g
and then .L
:
03 DISPLAY This is my first command
02 DISPLAY This is my third command
01 DISPLAY This is my second command
02 DISPLAY This is !y 3rd co!!and
To add something to the end of a command, you can use .A extrabit
(or .An extrabit
to add something to command n in the stack); and finally, for UNIX programmers having trouble remembering to enter commands and filenames in upper case, you can use .U
(or .Un
) to convert an entire command to upper case.
The number of commands kept in the stack is depends on the way your copy of UniVerse has been configured, but is usually about 100. Entering .L
will show you up to 20: to see more, enter .Ln
where n is the number of commands you wish to see.