home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / programm / 5295 < prev    next >
Encoding:
Text File  |  1992-11-16  |  993 b   |  35 lines

  1. Newsgroups: comp.unix.programmer
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!freia.inf.tu-dresden.de!ihle
  3. From: ihle@freia.inf.tu-dresden.de (Torsten Ihle)
  4. Subject: Re: Decompress while merging?
  5. Message-ID: <W6X8H3E@math.fu-berlin.de>
  6. Keywords: merge compress
  7. Sender: news@math.fu-berlin.de (Math Department)
  8. Organization: Free University of Berlin, Germany
  9. References:  <1992Nov15.231322.28100@cbnewsi.cb.att.com>
  10. Date: Mon, 16 Nov 1992 10:07:23 GMT
  11. Lines: 22
  12.  
  13. How about the following ( assuming the files are named file1.Z, file2.Z .. filen.Z ):
  14.  
  15. #! /bin/csh
  16. #creating a named pipe for each file 
  17. foreach n ( 1 2 .. n)
  18.     mkfifo pipe$n
  19. end
  20. #sorting the pipe-smoke
  21. sort5 -m pipe* | compress > sortfile.Z &
  22. # I need sort5 (on ULTRIX) to merge
  23. #filling the pipes
  24. foreach n ( 1 2 .. n)
  25.     zcat file$n.Z >> pipe$n &
  26. end
  27. #make clean
  28. foreach n ( 1 2 .. n)
  29.     rm pipe$n
  30. end
  31. wait
  32. # end of the script
  33.  
  34. I didn't try that for larger files, but on my system it works fine.
  35.