[Gllug] problems with comm

Richard Cohen richard at vmlinuz.org
Mon Feb 18 16:22:16 UTC 2002


On Mon, 18 Feb 2002, Steve Cobrin wrote:

> I'm scratching my head here. Can anybody help?
>
> I have two files containing lists of sorted numbers one per line. I want to
> find out what numbers are defined in one file rather than the other. I'm
> using "comm", but it *seems* to be giving me the wrong result, in fact it
> shouldn't return anything, but it does!
>
> Can anybody help?
> [I'm more interested in what I'm misinterpreting from comm, as opposed to a
> solution in Perl.]

>From the Solaris manpage:
     If the input files were ordered according to  the  collating
     sequence of the current locale, the lines written will be in
     the collating sequence of the original lines.  If  not,  the
     results are unspecified.

At least on my Solaris box at work, the collating sequence of the current
locale does *not* sort the files in numerical order, e.g. 7 comes after
65534.  Running the two files through sort puts them out-of-numerical-order,
but the comm works.

BTW - thanks for teaching me a new command.  I've never come across comm
before, in fact, I think I may have implmented it by hand once or twice...
:-)

[snip example]

> I'm using SuSE Linux 7.3, LC_COLLATE=POSIX, and my version of comm comes from
> GNU textutils-2.0.10-106

Hmm...  All my LC_* variables are en_GB.ISO8859-15.  I don't think that's
likely to be a problem though.

> 	-- Steve

Cheers
Richard


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list