#!/bin/sh 
#--------------------------- Shell MegaWave2 Macro --------------------------#
_sccsid="%Z%MegaWave %R%, %M% %I%, %G%";
_Func="Rename the contributors for MegaWave2 modules or macros (misspelled names)"
_Prog="`basename $0`"
_Vers="0.0"
_Date="1997"
_Auth="Jacques Froment";
_Usage="old_pattern new_pattern src_directory"
#----------------------------------------------------------------------------#
# This file is part of the MegaWave2 system macros. 
# MegaWave2 is a "soft-publication" for the scientific community. It has
# been developed for research purposes and it comes without any warranty.
# The last version is available at http://www.cmla.ens-cachan.fr/Cmla/Megawave
# CMLA, Ecole Normale Superieure de Cachan, 61 av. du President Wilson,
#       94235 Cachan cedex, France. Email: megawave@cmla.ens-cachan.fr 
#-----------------------------------------------------------------------------


if [ $# -ne 3 ]; then
  . .mw2_help_lg_com
fi

dir=$3
if [ ! -d $dir ]; then
  echo "Error: directory $dir not found !"
  exit 1
fi

for file in `ls ${dir}`
do
  if [ ! -d ${dir}/${file} ]; then
    (cd ${dir}; mw2rnauthor "$1" "$2" $file)
  else
   echo "--> ${dir}/${file} <--" 1>&2
   mw2rnauthor_all "$1" "$2" ${dir}/${file} 
   echo "<-- -->" 1>&2
  fi
done


exit 0




