[Top][All Lists]

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

bug#8040: join 5.97 bug

From: Eric Blake
Subject: bug#8040: join 5.97 bug
Date: Mon, 14 Feb 2011 17:26:08 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

[please don't top-post on technical lists]

On 02/14/2011 05:22 PM, Batson, Brannon wrote:
> Sorry, when I said 'join -v 1 d c', I meant 'join -v 1 b a'. The only files 
> involved are a & b which I sent contents for.
> The fundamental problem is that join and sort disagree on what 'sorted' means 
> in this case.

You didn't read my earlier comment:

> Coreutils 5.97 is OLD.  The latest stable release is 8.10, and it has
> improved diagnostics for helping you discover sorting problems with join:
> join --help reminds you that:
> Important: FILE1 and FILE2 must be sorted on the join fields.
> E.g., use ` sort -k 1b,1 ' if `join' has no options,
> or use ` join -t '' ' if `sort' has no options.

sort and join DO agree on what 'sorted' means, but ONLY if you use the
right options to one or the other program.  The difference in their
default behavior is an unfortunate wart of POSIX, but we can't change it
now, because 30 years of scripts rely on this difference.  So the best
you can do is to follow directions and use the correct sorting for the
task at hand, by supplying the right options to sort and/or join.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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