srcdir=/src/paws/src

if id | grep -l root
then
	root=true
else
	root=false
fi
echo 'Add or Erase access permissions for all of the pws files? (a/e): \c'
read option
if [ "$option" = "" ]
then
	echo DO NOT RUN ME IN BACKGROUND
	exit 1
fi
if [ $option = a ]
then
     echo Adding access permissions.
else if [ $option = e ]
     then
	echo Erasing access permissions.
     else
	echo You must type in either an 'a' for adding access permissions or
	echo an 'e' for erasing access permisions.
	exit 1
     fi
fi

echo 'enter login names (seperate multiple names with commas)'
read names
if echo $names | grep -l " " > /dev/null
then
	echo Names MUST be seperated with commas!!!!
	exit 1
fi

echo $0 will process in background.  Check logfile for progress.
echo do not logout!!!!!

echo '\noutput file for logging? \c'
read logfile

{
for i in $srcdir/pclib/[a-z]* $srcdir/pclib/include/[a-z]* $srcdir/*; do
  cd $i
  for j in $i/RCS/*,v 
  do
    base=`basename $j ,v`
    rcs -$option$names $base
    if [ $root = true ]
    then
	chown dew RCS/$base,v
	chgrp paws RCS/$base,v
    fi

  done
done
echo "******************"
echo "* modaccess done *"
echo "******************"
} 1>$logfile 2>&1
