new (un)compressdir scripts

sl at van-bc.UUCP sl at van-bc.UUCP
Fri Mar 13 16:02:58 AEST 1987


The following is a reworking of the (un)compressdir scripts.

Seems to work a little better, and only needs one copy. 

Cut and copy to compressdir, link to uncompressdir.

Have fun and enjoy!

Stuart Lynne

Not a shar file ------------ cut here --------------- cut here ---------

#! /bin/sh
#
# compress/uncompressdir
#
#	Tom Rushworth
#	Stuart Lynne
#					Mar/87
#
#
#	Modified from compress 4.0 release
#
OPTIONS=
FILES=
if test `basename $0` = "compressdir"; then
EFLAG=-v
COMPRESS=compress
else
EFLAG=
COMPRESS=uncompress
fi
for ARG
do
	case "$ARG" in
	-*)	OPTIONS="$OPTIONS $ARG";;
	*)	FILES="$FILES $ARG";;
	esac
done
if test -z "$FILES"; then
	FILES="."
fi
set $FILES
find $@ -type f -links 1 -print |
	egrep $EFLAG '\.Z$' |
	while read FILE
	do
		if test -r $FILE -a -s $FILE
		then
			$COMPRESS $OPTIONS $FILE
		fi
	done

-- 
Stuart Lynne	ihnp4!alberta!ubc-vision!van-bc!sl     Vancouver,BC,604-937-7532



More information about the Comp.sources.unix mailing list