#! /bin/tcsh -f ###################################################################### # # Finds the PDF files on the website and assembles a list of 'em set me=${0:t} # name of this script goto Start ###################################################################### Usage: cat << END_INPUT usage: $me:t Assembles a nicely formatted HTML file with a list of PDF files on the website. END_INPUT exit ###################################################################### Start: if ( ($# >= 1) ) then goto Usage endif # Abort if the required env variables aren't set if (! ${?HTML_DIR}) then echo ${me}: HTML_DIR environment variable not set\! exit endif set homeDir = ${HTML_DIR} set resultFile = $homeDir/tech/download/pdf-list.html set pathToRoot = "../.." # the path to $HTML_DIR from the resultFile set tmpFile_0 = ~/tmp/${me}.tmpFile_0 if (! -e $resultFile) then echo ${me}: "Can't find file '$resultFile'\!" echo Goodbye. exit endif echo -n "${me}: building list of PDF files..." # delete the old chunk from the file ed -s $resultFile << END_INPUT //,// d i . w Q END_INPUT cat << END_INPUT > $tmpFile_0