#!/bin/bash

# Script to automate version saving of the scripts and archiving them into a compressed
# tar file.

# Andrew Hunt
# 02/16/02

old_dir=`pwd`;

# handling of the version file
#if [-f version] then
#	version=`;

# change out of the directory
cd ~;

#determine the version number
version=${$old_dir:${#old_dir}-1:1};
#echo "Saving version=" $version;

#create the archive and add the directory
tar_file=$old_dir".tar.gz";
echo "File name to create " $tar_file;
tar cfvz $tar_file $old_dir;

#increment the version number
version=$((${version} + 1));
#rename directory
mvfile=${$old_dir:0:${#old_dir}-1}$version;
mv $old_dir $mvfile;

#fin
