#!/bin/sh
for F
do
	if [ -f "$F" ]
	then
		echo gzip "$F"
	elif [ -d "$F" ]
	then
		case "$F" in
		/* | . | .. | ./* | ../* )
		  echo "bad pathname $F - skipped"
		  continue ;;
		*/ )
		  F="${F%/}" ;;
		esac
		echo tar czf "$F".tgz "$F" "&&"
		echo rm -rf "$F"
	else
		echo "can't compress $F"
	fi
done
