# # A script to reformat a plain text file document into # some kind of html. It should recognise urls and convert # them to links or place some link token in from of them. # Author: m.j.bishop if [ "$1" = "" ] then echo "usage: txt2html.txt textFileName" exit 1; fi echo "" echo "" echo "" cat $1 | \ expand | \ sed -e "s//\>/g" | \ sed "s/[ ]*=[ ]*\(.*\)/

\1<\/h2><\/center>/gi" | \ sed "s/[ ]\{2\}/\ \ /g" | \ sed "s/\(http:\/\/[^ \n\r]\{3,\}\)/[*]<\/a> \1/gi" | sed "s/[^a-zA-Z\/]\(www\.[^ ]\{2,\}\)/[*]<\/a> \1/gi" | \ sed "s/^/
/g" echo "" echo ""