#!/bin/csh # update-header -- update expiration and modification dates on faq header; # modified output is written to standard output. # # get and parse the date set today = `date "+%m %d %y"` @ month = $today[1] @ day = $today[2] @ year = $today[3] + 2000 if ($month == 12) then @ nextmonth = 1 @ nextyear = $year + 1 else @ nextmonth = $month + 1 @ nextyear = $year endif set monthnames = `echo "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"` sed -e "s/Expires:.*/Expires: $day $monthnames[$nextmonth] $nextyear/" \ -e "s/Last-modified:.*/Last-modified: $day $monthnames[$month] $year/" \ < $1