These scripts are subject to endless repair, tweaking, and refinement. But this will give you the idea, at least. They're not well documented, so to understand them you'll just have to wade through my comments.


From time to time I run a script that scans HTML files for spelling and grammar inconsistencies (UK spelling instead of US, commas after quote marks, etc.), and assorted common typos. The basic script is typos, which takes a list of grep-style search patterns from the config file typos.patterns.

A few environment variables need to be set first in order for the remaining scripts to work. To do this, I put the following lines in my .cshrc (or .login) file:

setenv ATI ~/Sites/ati              # the website's home dir
setenv HTML_DIR $ATI                # where the html files live
setenv ZIP_DIR $ATI/zip             # where the zip files live
setenv DATE_FORMAT_ATI_FRIENDLY     "%A %b %e %Y"
setenv DATE_FORMAT_ATI_REV_DATE     "%A %Y-%m-%d"   
setenv DATE_FORMAT_ATI_VERSION      "%Y-%m-%d-%H"
setenv DATE_FORMAT_RSS              "%a, %d %B %Y %H:%M:%S %Z"

The main scripts are generally invoked in the following order:

  1. buildsite
  2. makebulk
  3. upload_to_server
In detail:
1. buildsite (a tcsh shell script; invoked by me, the webmaster)
Finds the html files that have been modified since the last invocation of this script, and applies timestamps to them. Also does some other housekeeping tasks.
stamp_rev-date (a tcsh shell script; invoked by buildsite)
Searches a given file for any time-stamp tags and inserts time-stamps there. It in turn calls the general-purpose stamp-insertion script stamp.
dtp-progress (a tcsh script; invoked by buildsite)
Generates and inserts a table of stats concerning the Dhamma Transcription Project.
sync-scripts (tcsh shell script; invoked by buildsite)
Copies shell scripts into the tech/scripts directory.
build_pdf-list (tcsh shell script; invoked by buildsite; calls the perl script getHdrForPDF.pl)
Constructs the master list of PDF files.
2. makebulk (a tcsh shell script; invoked by the webmaster)
Assembles a zip archive of the entire website. There's a lot going on here, including: removing chunks of text that had been tagged for exclusion from the bulk file (mainly text that won't work properly if the user is offline); preparing a master file list; tweaking the root directory of the bulk file so that the website is located in a directory named "html"; and so on.
BULKMAKE (a makefile invoked makebulk)
BULKMAKE is invoked by makebulk to create the bulk.zip archive of the website.
stamp_bulk (a tcsh script; used by bulkfix)
Stamps a bulk version number and bulk version date wherever it's needed.
bulklist (a tcsh shell script; invoked by makebulk)
Prepares two HTML files: one containing a list of all the files on the site, the other a list of the 25 most-recently modified files.
_newbulkroot (a tcsh shell script; invoked by makebulk)
Unzips bulk.zip into a temporary directory named html, then zips everything back up into the file atibulk.zip, along with a little redirect file named start.html. A casual user who unzips atibulk.zip will see only two items: the html folder and start.html. All the files are neatly tucked away out of sight in that html folder.
insert_chunk (a tcsh shell script; invoked by makebulk).
insert_chunk updates the RSS feed file with the latest info about the bulk file.
3. upload_to_server (a tcsh shell script; invoked by the webmaster)
This assembles a list of files that have been modified since the last upload, and then uploads them to the web host.

Other odds and ends:

backup-htaccess (a tcsh script; invoked by the webmaster)
Retrieves all the .htaccess directives from the remote server and formats them into a single HTML file. I run this from time to time to make sure I have local backup copies of all those directives.
bbinclude (a tcsh script; invoked by the webmaster)
Generates a list of BBEdit "include" files, along with a tally of how many times each one is used.
prepcd (a tcsh script; invoked by the webmaster)
Makes a copy of the ati directory and performs several preliminary cleanups for the CD-ROM version.