H='
==========
zoom [options]
==========
generate a list of directories. sort in reverse order. place all files
with ONE link in a zoo archive named for the directory. files with the
suffixes .tmp and *.bak are NOT included in the archives.
==========
'
PACK=
while	:
do
case $1 in
	-h)		clear; echo "$H";exit 0;;
	-x)		set -x;;
	-P)		PACK="P";;
	-*)		clear; echo "$H";exit 69;;
esac
case $# in
	0|1)	break;;
	*)		shift;;
esac
done
DLIST=${TMPDIR=/usr/tmp}/dl$$.tmp
:
trap 'rm -f $DLIST;exit' 0 1 2 3 4 14
:
case $# in
	0) 	find  . -type d -print | sort -r > $DLIST;;
	*) 	find $@ -type d -print | sort -r > $DLIST;;
esac
:
BASE=`pwd`
for i in `cat $DLIST`
do
case $i in
	.)	A=`pwd`;;
	*)	A=$i;;
esac
D=`basename $A | tr '[A-Z]' '[a-z]'`
cd $i
ktree . -ty f -li 1 ! -na '*.tmp' ! -na '*.bak' ! -na '*.zoo' -pr |
	zoo aIM $D
cd $BASE
done
