Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!maverick.ksu.ksu.edu!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!apple!agate!ziploc!eps From: eps@toaster.SFSU.EDU (Eric P. Scott) Newsgroups: comp.sys.next Subject: Re: File compressor Message-ID: <1308@toaster.SFSU.EDU> Date: 12 Feb 91 05:03:21 GMT References: <27B5D1B2.7226@ics.uci.edu> <27B7576A.5629@ics.uci.edu> <11FEB91204839@uazhe0.physics.arizona.edu> Reply-To: eps@cs.SFSU.EDU (Eric P. Scott) Distribution: usa Organization: San Francisco State University Lines: 77 In article <11FEB91204839@uazhe0.physics.arizona.edu> zazula@uazhe0.physics.arizona.edu writes: >Has anyone ported the PC archiver "ZIP" to the UNIX domain? There's an UNZIP for UNIX on WSMR-SIMTEL20.ARMY.MIL in PD1:UNZIP401.TAR-Z > Compress does do a great job but I don't like the idea of >TAR -> COMPRESS. You have to uncompress to look at the tar file contents. So? What's the problem? (Unless you only have 8MB RAM, ha ha, in which case it's gonna be S-L-O-W.) >With something like ZIP, ARC, ZOO ... you can list the files without >uncompressing them *AND* extract only the file(s) you want... tar also lets you extract only the files you want. If the gripe is just that you're LAZY (or have one of the new "improved" keyboards with the `|' off in never-never land, save the following as the file "list" (preferably somewhere found in your PATH) and do a chmod a+x list Then you can say "list whatever" and it will attempt to do something appropriate. #!/bin/csh -f set noglob if ($#argv < 1) then echo Usage: $0 archive ... exit 1 endif foreach a ($*) if ($#argv > 1) then echo ${a}: endif if (-d $a) then (cd $a && exec ls -l) else switch ($a) case *.a: ar tv $a breaksw case *.arc: arc v $a breaksw case *.tar.Z: if (-r $a) then zcat $a | tar tvf - else zcat $a >/dev/null endif breaksw case *.tar: tar tvf $a breaksw case *.zip: unzip -v $a breaksw case *.zoo: zoo -list $a breaksw default: if (-r $a) then echo unknown archive format else cat $a >/dev/null endif breaksw endsw endif end Oh, by the way, :-) :-) :-) -=EPS=-