#!/bin/sh

# Set things up

CLASSPATH="/usr/local/lib/java/jdk1.1/lib/classes.zip:."

wd=`/usr/bin/ls | /usr/bin/grep Test`

old_str=`echo $wd | /usr/bin/sed 's/Test_//g'`

new_str=`/usr/bin/date +%m%d%y%H%M%S`

cd $wd

# Create a new mutation of NoisyBear

cp NoisyBear.class.orig NoisyBear.class

/usr/local/lib/java/jdk1.1/bin/java -classpath $CLASSPATH HAMGen NoisyBear.class

chmod 644 NoisyBear.class

cd ..

# Rename the test directory

mv Test_${old_str} Test_${new_str}

# Fix NoisyBear.html

/usr/bin/sed "s/Test_$old_str/Test_$new_str/g" < NoisyBear.html > out

mv out NoisyBear.html

chmod 644 NoisyBear.html
