#!/bin/csh -f #-------------------------------------------------- # script: makejohn # author: john@december.com # date: 07 July 1996 # version: 1.1 # purpose: demonstrate file generation in HTML # includes XX- replacements # usage: makejohn filename "title" "annotation" #-------------------------------------------------- # Echo the input to announce the script is running echo "makejohn on" $* # This is where I'll store the generated file set GENLOC="../gen" # This is where I keep the source files set SRCLOC="../src" # I grab off the arguments and name them set FILE="$1" set TITLE="$2" set ANNOTATE="$3" set DATE=`date` # I start off with the head and replace the XX- strings cat $SRCLOC/johnhead.html | sed -e "s/XX-TITLE/$TITLE/g" -e "s/XX-ANNOTATION/$ANNOTATE/g" > $GENLOC/$FILE # I add the contents right after the head cat $SRCLOC/$FILE >> $GENLOC/$FILE # I now add the foot and replace the XX- strings cat $SRCLOC/johnfoot.html | sed -e "s/XX-FILE/$FILE/g" -e "s/XX-DATE/$DATE/g" >> $GENLOC/$FILE # I remind myself where the generated output is. echo "generated in $GENLOC/"$FILE