Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!sri-unix!sri-spam!parcvax!cdp!scott From: scott@cdp.UUCP Newsgroups: net.sources Subject: Re: new (un)compressdir scripts Message-ID: <2700008@cdp> Date: Mon, 23-Mar-87 02:15:00 EST Article-I.D.: cdp.2700008 Posted: Mon Mar 23 02:15:00 1987 Date-Received: Wed, 25-Mar-87 01:40:30 EST References: <360@van-bc.UUCP> Lines: 59 Nf-ID: #R:van-bc.UUCP:360:cdp:2700008:000:1243 Nf-From: cdp.UUCP!scott Mar 22 23:15:00 1987 Here's a much faster (modulo the nice) version of compressdir/uncompressdir, for systems that have xargs. -scott : # ----------------------------- ---------------------------- # # This is a shar archive. Extract with sh, not csh. # The rest of this file will extract: # compressdir # uncompressdir echo extracting - compressdir sed 's/^X//' > compressdir << '~FUNKY STUFF~' XOPTIONS= XFILES= Xfor ARG X do case "$ARG" in X -*) OPTIONS="$OPTIONS $ARG";; X *) FILES="$FILES $ARG";; X esac Xdone Xif [ -z "$OPTIONS" ] X then OPTIONS="-q" Xfi Xif [ -z "$FILES" ] X then FILES="." Xfi Xset $FILES X Xif [ ! -r $@ ] # file doesn't exist? X then exit 1 Xfi X Xfind $@ -type f -links 1 ! -name '*.Z' ! -name '?????????????*' -print | X xargs nice compress $OPTIONS >/dev/null 2>&1 ~FUNKY STUFF~ echo extracting - uncompressdir sed 's/^X//' > uncompressdir << '~FUNKY STUFF~' XOPTIONS= XFILES= Xfor ARG X do case "$ARG" in X -*) OPTIONS="$OPTIONS $ARG";; X *) FILES="$FILES $ARG";; X esac Xdone Xif [ -z "$FILES" ] X then FILES="." Xfi Xset $FILES X Xif [ ! -r $@ ] # file doesn't exist? X then exit 1 Xfi X Xfind $@ -type f -links 1 -name '*.Z' -print | X xargs nice uncompress $OPTIONS ~FUNKY STUFF~