Article View: comp.unix.shell
Article #2Sorting two files, then merging
From: Jack Vinson
Date: Tue, 27 Oct 1992 15:25
Date: Tue, 27 Oct 1992 15:25
20 lines
998 bytes
998 bytes
I am trying to use "Sort -m" to merge two sorted files. The obvious way to do this seems to be: sort file1 > sorted1 sort file2 > sorted2 sort -m sorted1 sorted2 > merged And if I need to process file1 first I can do this: sort file2 > sorted2 process file1 | sort -m - sorted2 > merged The question is, can I somehow compress all of this into one line? i.e. process file1 | sort -m - (sort file2) > merged That doesn't work, though. Is there something that might? The Purple Puddle Eater Jack Vinson vinson@unagi.cis.upenn.edu
Technical Details
Message-ID:
<94887@netnews.upenn.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!jvnc.net!netnews.upenn.edu!shiva.seas.upenn.edu!vinsonShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!jvnc.net!netnews.upenn.edu!shiva.seas.upenn.edu!vinson From: vinson@shiva.seas.upenn.edu (Jack Vinson) Newsgroups: comp.unix.shell Subject: Sorting two files, then merging Message-ID: <94887@netnews.upenn.edu> Date: 27 Oct 92 15:25:41 GMT Sender: news@netnews.upenn.edu Organization: The University of Pennsylvania Lines: 20 Nntp-Posting-Host: shiva.seas.upenn.edu