• Aucun résultat trouvé

Basic Editing of the Command Line

Dans le document Introduction to RT–11 (Page 157-160)

Using the Single-Line (SL) Command Editor

10.3 Editing the Command Line

10.3.1 Basic Editing of the Command Line

Basic command line editing generally involves two types of operations:

1. First, you use the arrow keys to move your cursor through the command line and into and out of the stack of previous commands. You use and to move through the command line. If you need to recall a command before editing, you use and to move through the command stack to recall that command.

2. Once you have placed your cursor at the desired location, you use other keypad and keyboard keys to delete, add, and manipulate characters within the command line.

As SL is distributed, any character you type within a command line is added;

that functionality is called INSERT mode. You can change that functionality while editing a command line so that any character you type replaces the character located at the cursor position; that is called REPLACE mode. You alternate between INSERT and REPLACE mode by pressing CTRL/A. SL returns to INSERT mode each time you press RETURN to issue a command.

The following table lists the keypad and keyboard keys you can use with basic command line editing and their functions. Following the table is an exercise that demonstrates using those keys.

Key Function

PF1 Changes the function of other keys when used in

combination with them. Also referred to as the GOLD key.

PF1 S Saves the displayed command. The S key is located on your main keyboard and is not case sensitive.

PF1 X Displays the saved command. The X key is located on your main keyboard and is not case sensitive.

PF2 Displays a screen of helpful SL information on the top half of your screen (above the command line). If you first issue the command, SET SL LEARN, subsequently pressing PF2 causes the SL help screen to be locked onto the display.

Issue the command SET SL NOLEARN to remove the help screen.

Key Function

PF4 Delete line function key. Deletes command line from cursor position to end of line. The PF1 PF4 combination restores the deleted line.

or CTRL/E Moves the cursor into the command stack, displaying previous commands. The PF1 combination displays the next command in the current cycle of commands. This cycle functionality is described in Section 10.4.3.

or CTRL/V Moves the cursor out of the command stack, displaying previous commands. The PF1 combination establishes an offset into the stack of previous commands. This set cycle functionality is described in Section 10.4.3.2.

or CTRL/D Moves the cursor toward the beginning of the command line. The PF1 combination moves the cursor to the beginning of the command line.

Moves the cursor toward the end of a command line. The

PF1 combination moves the cursor to the end of the command line.

LINE FEED or CTRL/J Deletes the element of command syntax to the left of the cursor. An element of syntax can be the device handler name and unit number, file name, file type or extension, command, any options, and any arguments to those options.

DELETE Deletes the character to the left of the cursor. The PF1

DELETE combination restores that deleted character or character position.

BACKSPACEor CTRL/H Switches the character at the current cursor position with the character to the right of the cursor and moves the cursor to the right. The PF1 BACKSPACE combination switches the character at the current cursor position with the character to the left of the cursor and moves the cursor to the left.

CTRL/B Requires that TT is set to condition NOFB. Same as

CTRL/F Requires that TT is set to condition NOFB. Same as

CTRL/R or CTRL/W Redisplays the current command line. Use CTRL/R or

CTRL/W to refresh the command line on your terminal screen if the command line becomes garbled or corrupted.

Key Function

CTRL/U Deletes all characters from the current cursor position to the beginning of the command line. The PF1 CTRL/U combination restores those deleted characters.

RETURN Issues the currently displayed command. You can press

RETURN and issue a command no matter where the current cursor position in that command. The PF1

RETURN combination truncates the command (deletes all characters from the cursor position to the end of the command line) and issues the truncated command.

The following exercise shows basic command line editing:

1. Type the following command but do not press RETURN: .DIRECTORY/FULL SY:

2. Press PF1 and S to save that command.

3. You could press RETURN and issue that command. However, for the purpose of this exercise, press CTRL/U to delete the command line.

4. Issue the following misspelled command exactly as shown:

.DILECTORY/PROTECT/ODRER:SIZE SY: RET

RT–11 returns an error message indicating an invalid command or that the command does not exist.

5. Press the key.

6. SL recalls the previous command:

.DILECTORY/PROTECT/ODRER:SIZE SY:

7. Examine that command line and note that the command DIRECTORY is misspelled as DILECTORY and the option /ORDER:SIZE is misspelled as /ODRER-:SIZE.

8. Press PF1 and . The cursor is then located at the beginning of the command line. Press until your cursor is positioned at the E character in DILECTORY:

.DILECTORY/PROTECT/ODRER:SIZE SY:

(If you go too far, you can return using .) 9. Press DELETE.

10. Type the letter R.

11. Correct the misspelled option /ODRER/SIZE. Press until the cursor rests on the letter D:

.DIRECTORY/PROTECT/ODRER:SIZE SY:

12. Press CTLR/H to switch the letter D with the letter to the right of it ( R ). Press

RETURN.

You have corrected the command and it executes.

13. Press PF1 and X to display the command you saved at the beginning of this exercise. Press RETURN to issue that command.

14. Continuously press to verify you have stored the commands you issued in this exercise on your stack of previous commands. After you display all the commands on your stack of previous commands, you are returned to the monitor prompt ( . ).

15. Press and hold down the key. You scroll back out through your stack of previous commands to the monitor prompt ( . ).

Dans le document Introduction to RT–11 (Page 157-160)