#!/bin/csh -f
# bzip2dir by Jun Nishii <jun@vinelinux.org>
#            Time-stamp: <2001-06-08 01:40:58 sagami>

if ($#argv == 0) goto err

while ($#argv)
	if (-d $1) then
		set dirname = `echo $1 | sed s/"\/"//`
		echo $dirname
		tar cvf $dirname.tar.bz2 --bzip2 $dirname
	else echo "directory $1 does not exist"
	endif
	shift
end
exit 0					#normal exit

err:
echo Usage: $0 "<dircetory>"
exit 1					#err exit
