Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ihnp4!alberta!ubc-vision!van-bc!sl From: sl@van-bc.UUCP Newsgroups: net.sources Subject: new (un)compressdir scripts Message-ID: <360@van-bc.UUCP> Date: Fri, 13-Mar-87 01:02:58 EST Article-I.D.: van-bc.360 Posted: Fri Mar 13 01:02:58 1987 Date-Received: Sat, 14-Mar-87 06:58:58 EST Organization: Public Access Network, Vancouver, BC. Lines: 56 Keywords: compress 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