#!/bin/csh -f # # Create a 4-column html table page from a plain-text file. # # Brent Chivers 2004/Jan/28 ##! /bin/csh -fb # for setuid/setgid scripts (tsk) # set verbose # see commands before variable substitution # set echo # see commands after variable substitution unset histchars # get other users' history characters out of the way unalias * # get other users' .cshrc stuff out of the way ## set nonomatch # don't require wildcard matches # $0:t construction doesn't work! set cmd_name = $0 set cmd_name = $cmd_name:t # the name of this command if ($#argv == 0) then # no arguments provided echo "usage: $cmd_name text_file(s)" echo " There should be a .head and a .tail file for each text file." exit endif foreach file ( $* ) cat $file.head > $file.html sed -e 's=^==' -e 's=$==' < $file | col4 | awk '{printf ("\n%s\n\n", $0)}' >> $file.html cat $file.tail >> $file.html end