next up previous contents index
Next: editing a existing file Up: Quick Ed Tutorial Previous: Quick Ed Tutorial

Creating a file

ed is only capable of editing one file at a time. Follow the next example to create your first text file using ed.

/home/larry# ed
a
This is my first text file using Ed.
This is really fun.
.
w firstone.txt
/home/larry# q

You can verify the file's contents using the Unix concatenate utility.

/home/larry# cat firstone.txt

The above example has illustrated a number of important points. When invoking ed as above you will have an empty file. The key tex2html_wrap8476 is used to add text to the file. To end the text entering session, a period tex2html_wrap8478 is used in the first column of the text. To save the text to a file, the key tex2html_wrap8274 is used in combination with the file's name and finally, the key tex2html_wrap8274 is used to exit the editor.

The most important observation is the two modes of operation. Initially the editor is in command mode. A command is defined by characters, so to ascertain what the user's intention is, ed uses a text mode, and a command mode.



Converted on:
Mon Apr 1 08:59:56 EST 1996