#!/bin/ksh
DIRS=`ls`
for i in ${DIRS}
do
if [ -d ${i} ]
then
	echo "Skipping ${i} directory..."
else
	j=${i}
	if [ `basename ${i} .gz` = ${i} ]
	then
		echo "Skipping unGZIPing ${i} ..."
	else
		echo "unGZIPing ${i} ..."
		gzip -d ${i}
		j=`basename ${i} .gz`
	fi
	if [ `basename ${j} .tar` = ${j} ]
	then
		echo "Skipping unTARying ${j} ..."
	else
		if [ -r ${j} ]
		then
			echo "unTARying ${j} ..."
			tar xf ${j} 
			echo "Removing TAR archive ${j} ..."
			rm -r ${j}
		fi
	fi
fi
done
