Beyond Linux From Scratch - Version 6.0

Chapter 6. Editors

Ed-0.2

Introduction to Ed

Ed is a line-oriented text editor.
It is used to create, display, modify and otherwise manipulate text
files, both interactively and via shell scripts. Ed isn't something
which many people use. It's described here because it can be used
by the patch program if you encounter an ed-based patch file. This
happens rarely because diff-based patches are preferred these days.

Additional downloads

Installation of Ed

Ed normally uses the mktemp function to create temporary
files in /tmp, but this function contains
a vulnerability (see the section on Temporary Files at
http://en.tldp.org/HOWTO/Secure-Programs-HOWTO/avoid-race.html).
Apply the following patch to make Ed use mkstemp instead, a secure way to create
temporary files:

patch -Np1 -i ../ed-0.2-mkstemp-1.patch

Install Ed by running the
following commands:

./configure --prefix=/usr --exec-prefix="" &&
make

Now, as the root user:

make install

Command explanations

--exec-prefix="": This forces
the programs to be installed into the /bin directory. Having the programs available there
is useful in the event of the /usr
partition being unavailable.

Contents

Installed
Programs:ed and red

Installed
Libraries:None

Installed
Directories:None

Short Descriptions

ed

is a line-oriented text editor.

red

is a restricted ed—it can only edit files in the
current directory and cannot execute shell commands.