aboutsummaryrefslogtreecommitdiff
path: root/bin/edda.mi5
blob: aaf974cfe27886beaf84af787d1d73b0cf863802 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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