Installing Ed-0.2

The Ed package contains a spartan line editor.

Approximate build time:  0.1 SBU
Required disk space:     3.1 MB

Official download location for Ed (0.2): 
ftp://ftp.gnu.org/gnu/ed/
And for the Ed Mkstemp Patch:
http://www.linuxfromscratch.org/patches/lfs/cvs/ed-0.2-mkstemp.patch

For its installation Ed depends on: Bash, Binutils, Coreutils, Diffutils, GCC, Glibc, Grep, Make, Sed.

Installation of Ed

Note: Ed isn't something which many people use. It's installed 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.

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

Apply the patch:

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

Now prepare Ed for compilation:

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

The meaning of the configure option:

Compile the package:

make

This package has a test suite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

Install the package:

make install

Contents of Ed

Installed programs: ed and red (link to ed)

Short descriptions

ed is a line-oriented text editor. It can be used to create, display, modify and otherwise manipulate text files.

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