#!/bin/sh

VERSIE=3.01

if [ $# = 0 ]; then
  echo "docver $VERSIE" 
  echo ""
  echo "   usage: docver major minor newmajor newminor <files>"
  echo ""
  echo "   example: docver 8 00 8 32 strext.hxx"
  echo "     replaces ' 8.00 ' by ' 8.32 '"
  echo ""
  exit
fi

MAJOR=$1;shift
MINOR=$1;shift
NWMAJ=$1;shift
NWMIN=$1;shift

for f in $*
do
  if [ -f $f ]; then
    echo "sed -e 's/ $MAJOR[.]$MINOR / $NWMAJ.$NWMIN /g' <$f >$f.1" >/tmp/$$.cmd
    cat /tmp/$$.cmd
    . /tmp/$$.cmd
    mv -f $f.1 $f
  fi
done

rm -f /tmp/$$.cmd

