bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: comm command bug while using with Tilda delimited files


From: Brian Dessent
Subject: Re: comm command bug while using with Tilda delimited files
Date: Thu, 25 May 2006 06:51:45 -0700

Anand Ramamoorthy wrote:

> This is the first time I'm having issues with "comm" command on an HP-UX Unix 
> box (Model: 9000/800, Release: B11.11)
> 
> I'm trying to compare two files that are "~" delimited.
> 
> File 1
> --------
> 1~10
> 5~30
> 55~40
> 6~20
> 
> 
> File 2
> --------
> 1~20
> 5~35
> 55~40
> 7~27

'comm' requires that the input files be sorted.  These are not sorted,
because "~" comes after "5" in the ascii order.  You can test this for
yourself with something like:

$ echo -e "5~30\n55~40" | sort
55~40
5~30

It works when you use "," because that character comes before the digits
in the ascii order.  Run your input files through 'sort' before passing
them to 'comm'.

Brian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]