EDITTEXT(1) — ACADEMIC LAB REPORT
Unix Text Only Laboratory Series
Date: 2026-05-05
NAME
edittext - comparative study of Unix text editors and stream editing
OBJECTIVE
To create, edit, search, and print a simple "Hello World" text file using
multiple Unix text processing tools: ed, sed (via pipe), Emacs, and Vim.
EQUIPMENT
Unix Command Line Utilities:
- ed (line editor)
- sed (stream editor)
- emacs (text editor)
- vim (text editor)
- standard shell (sh/bash)
PROCEDURE
1. USING ED (LINE EDITOR)
.prompt ed hello.txt
a
Hello World
.
w
q
Edit file:
.prompt ed hello.txt
,s/World/Unix/
w
Search and print:
/Unix/p
------------------------------------------------------------
2. USING SED (STREAM EDITOR VIA PIPE)
Create file:
.prompt echo "Hello World" > hello.txt
Modify using pipe:
.prompt cat hello.txt | sed 's/World/Unix/' > hello2.txt
Display result:
.prompt cat hello2.txt
------------------------------------------------------------
3. USING EMACS
.prompt emacs hello.txt
Inside Emacs:
- Type: Hello World
- Save: Ctrl + x, Ctrl + s
- Search: Ctrl + s (type "World")
- Replace: M-% World Unix
- Exit: Ctrl + x, Ctrl + c
------------------------------------------------------------
4. USING VIM
.prompt vim hello.txt
Inside Vim:
i
Hello World
ESC
:w
Edit:
:%s/World/Unix/g
:w
Search and print:
/Unix
:p
Exit:
:q
ANALYSIS
- ed provides minimal, scriptable line editing.
- sed enables non-interactive stream transformations.
- Emacs offers a full interactive editing environment.
- Vim balances modal efficiency with interactive control.
Each tool reflects a different philosophy of Unix text processing.
CONCLUSION
Unix text editors range from minimal (ed) to fully interactive (Emacs, Vim),
while sed demonstrates automation through pipelines. Mastery of these tools
enables flexible and powerful text manipulation workflows.