#!/bin/sh

## Replaces
## e-mail: user@uleth.ca
## by
## e-mail: <a href="mailto:user@uleth.ca">user@uleth.ca</a>
## in each of argument files, by editing in place using ed.

for i
do
	echo Fixing e-mail line in $i:
	echo Lines were:
	grep e-mail $i
	echo
	# Use "H" in ed commands for debugging
	/usr/bin/ed -s $i <<\EOF
/^e-mail:/ s;[a-zA-Z]*@[a-zA-Z.]*;<a href="mailto:&">&</a>;
w
Q
EOF
        echo Lines are now:
        grep e-mail $i
        echo
done
