aboutsummaryrefslogtreecommitdiff
path: root/bin/edda.mi5
diff options
context:
space:
mode:
Diffstat (limited to 'bin/edda.mi5')
-rw-r--r--bin/edda.mi521
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/edda.mi5 b/bin/edda.mi5
new file mode 100644
index 00000000..aaf974cf
--- /dev/null
+++ b/bin/edda.mi5
@@ -0,0 +1,21 @@
+# Run ed(1) over multiple files, duplicating stdin.
+self=edda
+
+# Need at least one file
+if [ "$#" -eq 0 ] ; then
+ printf >&2 'edda: Need at least one file\n'
+ exit 2
+fi
+
+<%
+include(`include/mktd.m4')
+%>
+
+# Duplicate stdin into a file
+script=$td/script
+cat >"$script" || exit
+
+# Run ed(1) over each file with the stdin given
+for file ; do
+ ed -- "$file" <"$script"
+done