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

Re: Possible bug in 'sort -m'



Cameron Hutchison wrote:
Bob McGowan wrote:

Here, I numerically sort and merge the two source files into a destination and count lines in all three. Then I get unique lines from the merged sort and count the result.
$ sort -n -m from_number to_number > xxx

A merge sort (sort -m) needs the input files to be already sorted. The
man page for -m says "merge already sorted files; do not sort". You have
not shown that from_number and to_number are already sorted, so there is
a possible failure right there.

You should also indicate the versions of sort and uniq that you are
using. There may well be bugs. Have you checked the changelogs for these
programs since your version to see if there have been related bugs
fixed?



Curses. I thought I had the from_number and to_number files sorted numerically, but, found that I had not ;((

So much for pulling out hair in frustration, I should have gone home and slept on it instead.

Nice catch and my apologies for the long winded posts.

Bob

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Reply to: