SlackBuilds Repository

14.2 > Academic > ed-v6 (c72c0e)

Old UNIX V6 ed, lightly ported to modern systems.

The old UNIX version of 'ed', the line editor. This is
intended to be for academic interest more than anything and
perhaps shouldn't be used for any serious editing of system
files etc. You have been warned! :)

The binary is named 'ed-v6' so as not to clobber gnu ed.

There are some major differences between this and POSIX ed
(see the notes at the end for more info.)

NOTE: The linked sources are redistributed on github
with no associated license.


Build a 32 bit binary on x86_64 (Multilib needed):


Build a static binary (size is ~ 800k vs. ~ 18k for the



1. compile with a K&R compiler (not even ansified);
replacing =+ with += and using "=" for default
2. assume 32-bits or better (ldiv and ldivr, increasing the
sbrk to 4096)
3. use setjmp+longjmp instead of sysexit+reset
4. use lseek() instead of seek() (although still assumes
512 bytes)
5. copies the tempfilename to work on systems without
writable strings
6. use SIG_IGN instead of the numeric value "1"
7. remove the goto errlab since that doesn't work in ANSI C
8. commented out getpid() in favor of a local copy
9. renamed unix() to run_unix() because some systems (at
least some linux) annoyingly do a -Dunix=1
10. use sizeof(buf) instead of buf
11. renamed putchar() to putc() because gcc and clang
generate errors if you create a function called putchar()
with a different signature.
12. added a prototype for errfunc() because clang refuses to
honor `-ansi`

I've tried to keep these modifications as minimal as
possible in an effort to preserve the editor that I learned
unix on.

`ed.c.orig` is included so you can verify how minimal my
changes were.



Added -D_XOPEN_SOURCE=500 to compile with fcntl.h in

Manual page:

If you are unfamiliar with ed then gnu ed has a very good
info page.

This is the closest I can find to the original man page:

Among other things, there is no -p option, single , or ;
will throw errors, no G//, and r does not support shell
commands. H and h are also unsupported, so errors will lack
any explanation.

Using with rlwrap:

This does work with rlwrap, however it repeats every
command. This doesn't affect the functionality, but it can
look quite confusing to have everything repeated.

Maintained by: Dave Woodfall
Keywords: ed,editor,ex,unix
ChangeLog: ed-v6


Source Downloads:
c72c0e9445af26bd9fde2d39da5628e6dabf36dd.tar.gz (797a81796fdaf0b35bbce721d08d7bd7)

Download SlackBuild:
ed-v6.tar.gz.asc (FAQ)

(the SlackBuild does not include the source)

Individual Files:

Validated for Slackware 14.2

See our HOWTO for instructions on how to use the contents of this repository.

Access to the repository is available via:
ftp git cgit http rsync

© 2006-2021 Project. All rights reserved.
Slackware® is a registered trademark of Patrick Volkerding
Linux® is a registered trademark of Linus Torvalds