*BSD News Article 11132


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA1286 ; Tue, 23 Feb 93 14:33:58 EST
Xref: sserve comp.unix.bsd:11185 comp.unix.misc:6436 comp.unix.shell:7747 comp.unix.questions:31240 comp.lang.perl:13544
Path: sserve!manuel.anu.edu.au!munnari.oz.au!uunet!not-for-mail
From: avg@rodan.UU.NET (Vadim Antonov)
Newsgroups: comp.unix.bsd,comp.unix.misc,comp.unix.shell,comp.unix.questions,comp.lang.perl
Subject: Re: Splitting a file - HELP WANTED
Date: 13 Feb 1993 22:31:05 -0500
Organization: Berkeley Software Design Inc, Falls Church, VA
Lines: 19
Message-ID: <1lkedpINN4sn@rodan.UU.NET>
References: <1993Feb12.151748.20280@news.eng.convex.com> <1lgrjgINNfrl@gaia.ucs.orst.edu> <1lj7mvINNm97@uther.cs.purdue.edu>

In article <1lj7mvINNm97@uther.cs.purdue.edu> spaf@cs.purdue.edu (Gene Spafford) writes:
>sort <A >A.sort
>sort <B >B.sort
>comm -12 A B >InBoth
>comm -23 A B >Aonly
>comm -13 A B >Bonly

Sorry for the nitpicking; the correct sequence is:

sort -u <A >A.sort
sort -u <B >B.sort
comm -12 A.sort B.sort >InBoth
comm -23 A.sort B.sort >Aonly
comm -13 A.sort B.sort >Bonly
rm A.sort B.sort

(Actually you can do with only one temporary file).

--vadim