• Aucun résultat trouvé

Calling the System Job

Dans le document Introduction to RT–11 (Page 122-127)

Using the System Job Feature

7.3 Calling the System Job

System jobs are of two types. One type of system job runs transparently once started.

Such a system job is SPOOL. Once you start SPOOL you need not call it. This section discusses the other type of system job — the type you call to use.

You can connect to only one background job or foreground job. Therefore, to summon a job running in the background environment, press CTRL/B. Press CTRL/F to summon a job running in the foreground environment. System jobs are different from background and foreground jobs in that you have to call them by name. Press

CTRL/X to summon the system job environment, then specify the system job by name because there can be up to six system jobs running at the same time.

From the Background

As a result of the previous section, you are now running two editors as system jobs:

KEX and KEX1. The following exercise demonstrates how to call those jobs.

1. Press CTRL/X. RT–11 displays the system job environment prompt:

Job?

2. Type KEX in response to the system job environment prompt and press RETURN: Job? KEX RET

3. RT–11 displays the system job prompt and positions the cursor below that prompt:

KEX>

Although the asterisk ( * ) is not displayed, the cursor resides at the KEX utility command prompt. You can optionally display the KEX utility command prompt by pressing RET.

4. You then type the name of the file you want to edit or create. For the purpose of this exercise, create a file on your default data device named MYFIL.TXT:

KEX>

MYFIL.TXT RET

RT–11 searches your directory for that file, does not find it (you are creating it), and returns the following prompt in reverse video:

?KEX-W-File not found - Create it (Y,N)?

Type Y to create that file. The KEX editor then opens that file for you to edit.

For the purpose of this exercise, press RETURN a couple of times and then type the following text:

This is file MYFIL.TXT created using KEX.

5. Press CTRL/B. The background environment prompt (B>) appears on your terminal screen; you are now in the background. Optionally, you can press RET to display the keyboard monitor prompt ( . ). You can now enter a command to start another system job, run a foreground job or a background job, or perform an operation such as copying or printing a file. The file MYFIL.TXT is still open on the KEX editor.

6. Do the following to return to your file MYFIL.TXT (open on KEX):

a. Press CTRL/X to display the system job environment prompt.

b. Specify the system job KEX. Press RETURN. c. Press CTRL/W to repaint your screen.

You are back in your file MYFIL.TXT and the cursor is in the same position as you left it.

In that manner, you can move between a system job and the background environment. You move between a system job and the foreground environment in the same manner, except you use CTRL/F to summon the foreground job.

From Another System Job

You can also move from one system job to another. You started another KEX editor in the previous section and named that second KEX editor KEX1. You are now going to open a file with KEX1 and move back and forth between the two editors.

1. While still in the file MYFIL.TXT, press CTRL/X. RT–11 displays the system job environment prompt:

Job?

2. Type the system job KEX1. Press RETURN. Job? KEX1 RET

3. RT–11 displays the system job prompt:

KEX1>

4. Type the file name MYFIL1.TXT and press RETURN. KEX1>

RT–11 searches your default data device directory for that file, does not find it (you are creating it), and returns the following prompt in reverse video:

?KEX-W-File not found - Create it (Y,N)?

Type Y to create that file. KEX1 then opens that file for you to edit. For the purpose of this exercise, press RETURN a couple of times and then type the following text:

This is file MYFIL1.TXT created using KEX1.

This sentence is going to be copied over to MYFIL.TXT further along in this section.

5. Press CTRL/B to return to the background environment. You can then press

RETURN a few times to make the display easier to read.

You now have files open on two different editors and are in the background environment. You can enter a command to start another system job, start a program in the foreground environment or the background environment, or perform other operations.

You can summon either editor by pressing CTRL/X, supplying the editor name, and pressing RETURN. Pressing CTRL/W repaints your terminal screen with the file opened on that editor. The cursor is positioned in each file where you left it — each editor is currently running, contains an opened file, and is waiting for input.

Example Interaction Between System Jobs

You can use KEX’s auxiliary file feature to transfer any part of a file between two (or more) KEX editors you are running as system jobs. The following is the general procedure, followed by an exercise that illustrates the procedure. You should read the procedure and perform the exercise.

1. Open an output file from the editor that contains the part of a file you want to transfer.

You should use a consistent file extension when you are creating an auxiliary output file for this purpose, such as .AUX.

2. Write the part of the file you want to transfer to the auxiliary output file. Then close that auxiliary output file.

3. Call the editor which has the file opened that is to receive the contents of the auxiliary file. Using your keypad, move to the point in that file where you want the auxiliary file written.

4. Open that auxiliary file as an input file. Then, include the contents of the auxiliary file in the file you are currently editing.

5. Optionally, you can then go to the background environment and delete the auxiliary file.

The following exercise demonstrates the procedure described above. You currently have files opened on two KEX editors: MYFIL1.TXT on KEX1 and MYFIL.TXT on KEX. You are going to transfer the following line from MYFIL1.TXT to MYFIL.TXT:

This sentence is going to be copied over to MYFIL.TXT further along in this section.

Do the following:

1. Call the editor which has the file opened that contains the part you want to transfer:

a. Press CTRL/X Job? KEX1 RET

b. Press CTRL/W to repaint your screen with the contents of MYFIL1.TXT.

2. Open the auxiliary output file:

Press PF1 7

Command:OPEN OUTPUT MYFIL1.AUX ENTER 3. Write the file part to the auxiliary file:

a. Using the keypad, move the cursor to the beginning of the target, (This sentence is going ...), and press . to initiate a select range.

b. Move the cursor to the end of the target and press PF1 7 . Command:WRITE SELECT ENTER

This exercise involves only one line. In practice, you can transfer virtually any amount of text or data in this manner. The size of your cut and paste buffer does not limit auxiliary files.

Note that the line still remains in the file; you have not deleted it but rather copied it.

c. Press PF1 7

Command:CLOSE ENTER

4. Call the editor containing the file to which you want to write the auxiliary file:

a. Press CTRL/X Job? KEX RET

b. Press CTRL/W to repaint your screen with the contents of MYFIL.TXT.

5. Open the auxiliary file as an input file:

Press PF1 7

Command:OPEN INPUT MYFIL1.AUX ENTER 6. Include the auxiliary file:

a. Using the keypad, move the cursor to where you want to write the target line.

b. Press PF1 7

You will see the contents of the auxiliary file MYFIL1.AUX written into your file.

7. Delete the auxiliary file:

Under different circumstances, you may want to save the auxiliary file. However, as this is an exercise:

a. Press CTRL/B

b. Issue the following command:

.DELETE MYFIL1.AUX RET

In that manner, you can transfer text or data between files that are open on editors running as system jobs.

For the purpose of this exercise, you are now going to make permanent the file MYFIL.TXT. Any time you open a file on an editor, you open a temporary file. If you open a file but do not close it, no directory entry is created for that file. You are going to close the file MYFIL.TXT and make it permanent with the EXIT command.

You will then display the file’s directory entry, type the file, and delete the file.

1. Press CTRL/X to display the system job environment prompt.

2. Notify RT–11 that you want to summon the KEX editor by typing KEX in response to that prompt and pressing RETURN:

Job? KEX RET KEX>

3. Press CTRL/W to repaint your terminal screen. KEX displays the contents of MYFIL.TXT.

4. Press the PF1 7 keypad keys and issue the command EXIT:

Command:EXIT ENTER

5. KEX closes the file MYFIL.TXT and displays its utility command ( * ) prompt.

You could at that point create another file or open an existing file for editing on KEX by typing a file name. Instead, press CTRL/B to return to the background environment.

6. Issue the following command to display the directory entry for MYFIL.TXT:

.DIRECTORY MYFIL.TXT RET

RT–11 displays the directory entry for that file.

7. Issue the following command to type that file on your terminal screen:

.TYPE MYFIL.TXT RET

RT–11 types that file on your terminal screen.

8. Issue the following command to delete MYFIL.TXT from your directory. You have not protected that file by issuing the PROTECT command, so you can delete that file without issuing the UNPROTECT command:

.DELETE MYFIL.TXT RET

RT–11 deletes that file from your directory.

For the purpose of this exercise, you are now going to eliminate the temporary file MYFIL1.TXT, currently opened on KEX1. No permanent directory entry exists for MYFIL1.TXT because you have opened it on KEX1 for the first time. The QUIT command stops the editing of the file MYFIL1.TXT without closing it. Therefore, no directory entry is created for MYFIL1.TXT; it is not made permanent.

1. Press CTRL/X to display the system job environment prompt.

2. Notify RT–11 that you want to summon the KEX1 editor by typing KEX1 in response to that prompt and pressing RETURN:

Job? KEX1 RET

KEX1>

3. Press CTRL/W to repaint your terminal screen. KEX1 displays the contents of MYFIL1.TXT.

4. Press the PF1 7 keypad keys and issue the command QUIT:

Command:QUIT ENTER

5. KEX1 removes the file MYFIL1.TXT, does not save it, and displays its utility command ( * ) prompt. You could at that point create another file or open an existing file for editing on KEX1 by typing the file name. Instead, press CTRL/B to return to the background environment.

Dans le document Introduction to RT–11 (Page 122-127)