#!/bin/shPARTS="1 2 3 4 5 6 7 8"NPARTS=8SUBJECT="Medical Image Format FAQ"#NEWSGROUPS="pax.test"NEWSGROUPS="alt.image.medical,comp.protocols.dicom,sci.data.formats,alt.answers,comp.answers,sci.answers,news.answers"INEWS="inews -h -d world -n $NEWSGROUPS"#INEWS="cat"makeexpires() {  if [ "$1" = "" ]  then    longevity="1"  else    longevity="$1"  fi  year=`date +%Y`  month=`date +%m`  day=`date +%d`  if [ "$day" -gt 28 ]; then day=28; fi  month=`expr $month + $longevity`  while [ $month -gt 12 ]  do    year=`expr $year + 1`    month=`expr $month - 12`  done  case $month in    1)  amonth="Jan";;    2)  amonth="Feb";;    3)  amonth="Mar";;    4)  amonth="Apr";;    5)  amonth="May";;    6)  amonth="Jun";;    7)  amonth="Jul";;    8)  amonth="Aug";;    9)  amonth="Sep";;    10)  amonth="Oct";;    11)  amonth="Nov";;    12)  amonth="Dec";;  esac  echo "$day $amonth $year 00:00:00 GMT"}EXPIRES=`makeexpires 1`changesname=../html/changes.htmltocname=../html/toc.htmlversion=`egrep '^Version:' ../html/index.html | awk '{print $2}'`for part in $PARTSdo  i=part$part  bodyname=../html/$i.html  headname=$i.headforpost  if [ ! -f $headname -a -f partn.headforpost ]  then    headname=partn.headforpost  fi  if [ -f $bodyname -a  -f $headname ]  then    topost=$i.topost    rm -f $topost    echo "Expires: $EXPIRES" >$topost    sedstring1="s/^Version:.*/Version: $version/"    sedstring2="s/^Last-modified:.*/Last-modified: `date`/"    sedstring3="s/^Subject:.*/Subject: $SUBJECT, Part $part\/$NPARTS/"    sedstring4="s/^Archive-name:.*/Archive-name: medical-image-faq\/part$part/"#    sed -e "$sedstring1" -e "$sedstring2" -e "$sedstring3" -e "$sedstring4" <$headname | ../bin/justify >>$topost    sed -e "$sedstring1" -e "$sedstring2" -e "$sedstring3" -e "$sedstring4" <$headname | fmt -s -80 >>$topost    if [ $i = part1 -a -f $changesname ]    then#        ../bin/unhtml <$changesname | ../bin/getbody | ../bin/justify \#            | sed 's/[        ]*$//g' | ../bin/foldnl >>$topost        ../bin/unhtml <$changesname | ../bin/getbody | fmt -s -80 \            | sed 's/[        ]*$//g' | ../bin/foldnl >>$topost    fi    if [ $i = part1 -a -f $tocname ]    then#        ../bin/unhtml <$tocname | ../bin/getbody | ../bin/justify \#            | sed 's/[        ]*$//g' | ../bin/foldnl >>$topost        ../bin/unhtml <$tocname | ../bin/getbody | fmt -s -80 \            | sed 's/[        ]*$//g' | ../bin/foldnl >>$topost    fi#    ../bin/unhtml <$bodyname | ../bin/getbody | ../bin/justify \#        | sed 's/[        ]*$//g' | ../bin/foldnl >>$topost    ../bin/unhtml <$bodyname | ../bin/getbody | fmt -s -80 \        | sed 's/[        ]*$//g' | ../bin/foldnl >>$topost    $INEWS $topost    rm -f $topost  else    echo "Error - file doesn't exist: $bodyname or $headname"    exit 1  fidoneexit 0