home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.programmer
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!freia.inf.tu-dresden.de!ihle
- From: ihle@freia.inf.tu-dresden.de (Torsten Ihle)
- Subject: Re: Decompress while merging?
- Message-ID: <W6X8H3E@math.fu-berlin.de>
- Keywords: merge compress
- Sender: news@math.fu-berlin.de (Math Department)
- Organization: Free University of Berlin, Germany
- References: <1992Nov15.231322.28100@cbnewsi.cb.att.com>
- Date: Mon, 16 Nov 1992 10:07:23 GMT
- Lines: 22
-
- How about the following ( assuming the files are named file1.Z, file2.Z .. filen.Z ):
-
- #! /bin/csh
- #creating a named pipe for each file
- foreach n ( 1 2 .. n)
- mkfifo pipe$n
- end
- #sorting the pipe-smoke
- sort5 -m pipe* | compress > sortfile.Z &
- # I need sort5 (on ULTRIX) to merge
- #filling the pipes
- foreach n ( 1 2 .. n)
- zcat file$n.Z >> pipe$n &
- end
- #make clean
- foreach n ( 1 2 .. n)
- rm pipe$n
- end
- wait
- # end of the script
-
- I didn't try that for larger files, but on my system it works fine.
-