groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Old *roff utilities - found a diffmk, any checkmm?


From: Larry Jones
Subject: Re: [Groff] Old *roff utilities - found a diffmk, any checkmm?
Date: Wed, 29 Jan 2003 17:00:09 -0500 (EST)

address@hidden writes:
> 

> While indexing Chapter 15 last night, I ran into a reference to a
> utility called "diffmk" that compared two *roff documents and created a
> third document with change bars in the right places. Hm... Google didn't
> point me to the original code, but I did find a Perl script called
> diffmk.p that purported to do the same thing. I haven't tried it out --
> yet! -- but here's a link if you're interested:

If you have GNU diff, here's a simple shell script that works for me:

#! /bin/sh
if [ $# -ne 3 ]; then
        echo "Usage: $0 file1 file2 file3"
        exit 1
fi
if [ "$1" = "$2" -o "$1" = "$3" -o "$2" = "$3" ]; then
        echo "$0: file names must be distinct"
        exit 1
fi
if [ "$3" = "-" ]; then
        echo "$0: file3 cannot be -"
        exit 1
fi
diff --old-group-format='.mc \(**
.mc
' --new-group-format='.mc \(br
%>.mc
' --changed-group-format='.mc \(br
%>.mc
' "$1" "$2" |
sed -e'/^\.T[S&]/{:loop' -e'N' -e'/\n\.mc.*/s///' -e'/..*\./!bloop' -e'}' >$3

-Larry Jones

Any game without push-ups, hits, burns or noogies is a sissy game. -- Calvin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]