Home | History | Annotate | Line # | Download | only in mantools
hchangered revision 1.1.1.1
      1  1.1  tron #!/bin/sh
      2  1.1  tron 
      3  1.1  tron # Usage: hchangered oldfile newfile
      4  1.1  tron 
      5  1.1  tron # hchangered - crude tool to red-color changes in HTML text. Text is 
      6  1.1  tron # also underlined so it shows on monochrome printers.
      7  1.1  tron 
      8  1.1  tron # Bugs: does not red-color text inside tables. Fascist software may
      9  1.1  tron # complain about tags being out of order.
     10  1.1  tron 
     11  1.1  tron diff -e $1 $2 | (sed -n -e '
     12  1.1  tron /[ac]$/{
     13  1.1  tron 	p
     14  1.1  tron 	a\
     15  1.1  tron <font color="red"><u>
     16  1.1  tron : loop
     17  1.1  tron 	n
     18  1.1  tron 	/^\.$/b done1
     19  1.1  tron 	p
     20  1.1  tron 	b loop
     21  1.1  tron : done1
     22  1.1  tron 	a\
     23  1.1  tron </u></font>\
     24  1.1  tron .
     25  1.1  tron 	b
     26  1.1  tron }
     27  1.1  tron /d$/{
     28  1.1  tron 	a\
     29  1.1  tron 	i\
     30  1.1  tron <font color="red"><u>[DELETED]</u></font>\
     31  1.1  tron .
     32  1.1  tron 	p
     33  1.1  tron 	b
     34  1.1  tron }
     35  1.1  tron '; echo '1,$p') | ed - $1 | perl -e '
     36  1.1  tron $buf = join("", <STDIN>);
     37  1.1  tron $buf =~ s/pre>\s+<font/pre><font/g;
     38  1.1  tron $buf =~ s/font>\s+<\/pre/font><\/pre/g;
     39  1.1  tron print $buf;
     40  1.1  tron '
     41