bug in the unix join command or maybe in the sort command
From:
Robert Castelo
Subject:
bug in the unix join command or maybe in the sort command
Date:
Wed, 19 Jan 2005 16:20:29 +0100
hi,
i'd like to report what i think it's a bug of the unix command 'join'.
i'm using FEDORA core 2.0
create a file p.txt containing the letter 'a' followed by a newline:
$ cat p.txt
a
and a file q.txt containing two columns separated by a tab as follows:
$ cat q.txt
aa value-aa
a value-a
where each line ends with a newline character.
if i perform a sort command on the file q to order it by the first
column i obtain the same ordered contents indicating that the lines are
already ordered properly:
$ sort -k 1,1 q.txt
aa value-aa
a value-a
however, if i perform a join command on p.txt and q.txt it doesn't join
the line with the common value 'a' on the first column of both files!!
$ join p.txt q.txt
if i swap manually the lines in q.txt:
$ cat q.txt
a value-a
aa value-aa
and perform the join, then it works!!
$ join p.txt q.txt
a value-a
am i doing something wrong or is this a bug in sort and/or in join.
thanks!
robert.