It's rather basic, and somewhat recursive, however it has a very very nagging flaw. It will NOT check-in, check-out files named index. So index.php would not work, but anything else will work.

It's stumping me entirely. Any advice?

TiA.

#! /bin/bash
#Begin the stuff

#Makes the directory in tmp
mkdir /tmp/RCS
#Gets the folders, and sets the variables
ls -R |grep ./ |cut -d '.' -f2 |cut -d ':' -f1 > /tmp/RCS/1
head=1
pwd=`pwd`


#puts all of the stuff where it needs to go, aka the pwd
while
[ $head -lt 1300 ]
do
line=`cat /tmp/RCS/1 | head -${head} | tail -1 `
echo "${pwd}${line}" >> /tmp/RCS/2
head=$(( $head + 1 ))
done
#every folder is now in the form of /dir1/dir2/dir3

#Sets the other variable, linenumber(ln)
ln=1
#Begins the big loop
while
[ $ln -lt 10000 ]
do
#This part extracts the directory and moves to it.
dir=`cat /tmp/RCS/2 |head -${ln} |tail -1`
echo "Directory is $dir"
cd $dir
#This lists all of the files ending in .php, .shtml, and .html
#thanks to MR forumers
ls |grep -v ',v$' | egrep '\.(php|shtml|html)' > /tmp/RCS/3
echo "Showing the Contents"
#Little debugging thing, shows the php, shtml, and html contents of the folder
cat /tmp/RCS/3
#Gets how long it should go to.
wordc=`cat /tmp/RCS/3 | wc -l`
hln=1
#Start the second loop to check in, check out the files
while
[ $hln -lt $wordc ]
do
#This gets the filename
filename=`cat /tmp/RCS/3 |head -${hln} |tail -1`
#Echos the filename
echo "Filename is $filename"
#Checks in and out the file, creating the RCS ,v file
ci -q -t-"File $filename" $filename
co -q $filename
hln=$(( $hln + 1 ))
done
ln=$(( $ln + 1 ))
otherpwd=`pwd`
echo "Currently working in $otherpwd"
if
#Checks to see if an RCS directory is there, if it is, move the ,v to it, if not make then move
[ -d RCS ] ;then
echo "Moving to folder RCS"
mv -f *,v RCS
elif
[ ! -d RCS ] ; then
echo "Making RCS and moving to it"
mkdir RCS
mv -f *,v RCS
fi
done
#Remove the tmp file
rm -rf /tmp/RCS


#Done by microchip13.