summaryrefslogtreecommitdiff
path: root/academic/ed-v6/README
diff options
context:
space:
mode:
Diffstat (limited to 'academic/ed-v6/README')
-rw-r--r--academic/ed-v6/README85
1 files changed, 85 insertions, 0 deletions
diff --git a/academic/ed-v6/README b/academic/ed-v6/README
new file mode 100644
index 0000000000..373767752c
--- /dev/null
+++ b/academic/ed-v6/README
@@ -0,0 +1,85 @@
+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.
+
+OPTIONS
+
+Build a 32 bit binary on x86_64 (Multilib needed):
+
+ M32=yes
+
+Build a static binary (size is ~ 800k vs. ~ 18k for the
+dynamic):
+
+ STATIC=yes
+
+
+DEVELOPER'S NOTES
+
+ 1. compile with a K&R compiler (not even ansified);
+ replacing =+ with += and using "=" for default
+ assignment
+ 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.
+
+
+MAINTAINER'S NOTES
+
+Compilation:
+
+Added -D_XOPEN_SOURCE=500 to compile with fcntl.h in
+glibc-2.23.
+
+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:
+
+https://www.freebsd.org/cgi/man.cgi?query=ed&apropos=0&sektion=0&manpath=Unix%20Seventh%20Edition&arch=default&format=html
+
+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.