#!/bin/ksh # Script to highlight a list of names (last names with no blank spaces) # within an HTML document. The output is a new copy of the HTML # document that can be viewed and printed with a web browser. # # Usage: # # bold # # where is the HTML document and is the list of names. # File To Highlight. file=$1 echo $file # List Of Names. names=`cat $2` # echo $names # Working files. tmp1="junk1" tmp2="junk2" # Set up temporary file. cat $file >> $tmp1 # For each name, add the bolding commands. for name in $names do echo $name cat $tmp1 | awk "{gsub(\"$name\",\"$name\");print}" > $tmp2 mv -f $tmp2 $tmp1 done # Rename the output file, and clean up. mv -f $tmp1 $file.bold rm -f $tmp2 echo "The output is in: $file.bold"