HP NonStop G-Series User Manual

Page 92

Advertising
background image

4.

Close the file file1 by pressing the Esc key (to exit from insert mode) and then typing a
:

(colon) followed by the letter w and pressing Return (:w <Return>). The w instructs the

OSS system to write (save) a copy of the file.

Your screen should look like the following:

You start the vi program by entering the command vi,
optionally followed by the name of a new or existing file.
~
~
~
~
~
~
"file1" [New file] 2 lines, 112 characters

Note that the name of the new file and the number of lines and characters it contains are
displayed.

You are still in vi. To exit vi, type a : (colon) followed by the letter q (:q). The q instructs
vi

to quit and return you to the shell prompt.

Now you need to create two more files for examples in the following subsections. The procedure
is the same as the one you used to create file1, but the text you enter is different.

5.

To create the second file, file2, enter the following:

vi file2

Open System Services responds with a screen that looks like the following:

~
~
~
~
~
~
~
"file2" [New file]

The message "file2" [New file] indicates that file2 is a new file.

Indicate that you want to add text to the new file by typing the letter i. Then enter the following
text:

If you have created a new file, you will find
that it is easy to add text.

Then press Esc, type a : (colon), followed by the letter w, and press Return to save the file.

Your screen should look like the following:

If you have created a new file, you will find
that it is easy to add text.
~
~
~
~
~
~
~
"file2" [New file] 2 lines, 75 characters

Enter a :q and press Return to quit vi.

6.

To create the third file, follow the instructions in Step 5. However, name the file file3, and
enter the following text:

You will find that vi is a useful
editor that has many features.

Then, press Escape, type a : (colon), followed by a w and then a q (:wq), and press Return.

92

Creating Files

Advertising
This manual is related to the following products: