Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!unido!mikros!mwtech!martin From: martin@mwtech.UUCP (Martin Weitzel) Newsgroups: comp.unix.shell Subject: Re: Problem using multiple 'head' commands in shell script Keywords: head shell buffering Message-ID: <1081@mwtech.UUCP> Date: 31 Jan 91 23:23:30 GMT References: <1671@abekrd.UUCP> <6925@exodus.Eng.Sun.COM> <1678@abekrd.UUCP> Reply-To: martin@mwtech.UUCP (Martin Weitzel) Organization: MIKROS Systemware, Darmstadt/W-Germany Lines: 25 In article <1678@abekrd.UUCP> garyb@abekrd.UUCP (Gary Bartlett) writes: [...] :*** FLASH OF INSPIRATION *** : :I have an idea: :- Process the original file by putting the line number at the beginning of : each line, Good. :- Process the file to be merged so that the merge points are at the beginning : of each of these lines, Good. :- Cat the two processed files together and pass through 'sort', Depending on how the lines look like it may also be possible to use join(1). :- Remove line numbers from beginning of resulting file, QED and split the joined lines. -- Martin Weitzel, email: martin@mwtech.UUCP, voice: 49-(0)6151-6 56 83