[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
question about behavior of sort -n -t,
From: |
Gabriel Gaster |
Subject: |
question about behavior of sort -n -t, |
Date: |
Tue, 8 Oct 2013 16:18:03 -0500 |
Hello all,
I have a question about the behavior of sort -n.
Evidently, even if a user specifies a field-separator, the entire line is still treated as a key. If the entire key is not numeric, then sort -n does not throw any errors and seems to not do numeric sort and rather does some other sort (the order of which I am unclear on). This strikes me as unexpected behavior -- because the caller can think he's going to get numeric sort and not get numeric sort.
As far as I can tell, specifying field-separator and calling numeric *should* sort numerically _if_ the key is numeric. Furthermore -- and I suppose this is the main thing -- if a field-separator is specified, then the key should default to each field and not to the entire line. Why else would one specify a field-separator if not to use it in this way?
Can someone shed more light into this ? I'm also not sure if there is an existing conversation about this, if it's being changed in a later release, or if this is a known and long debated issue, or whatnot.
I'm eager to make contributions in this regard, of course. I would mostly like to know the current discussion of these things and what the current thinking is on sort -n -t','.
Thanks much
Gabe
--
gabriel gaster
data scientist
datascope analytics
cell: +1.773.816.3349
skype: gabrielgaster
- question about behavior of sort -n -t,,
Gabriel Gaster <=
- Re: question about behavior of sort -n -t,, Eric Blake, 2013/10/08
- Re: question about behavior of sort -n -t,, Pádraig Brady, 2013/10/08
- Re: question about behavior of sort -n -t,, Eric Blake, 2013/10/08
- Re: question about behavior of sort -n -t,, Gabriel Gaster, 2013/10/09
- Re: question about behavior of sort -n -t,, Gabriel Gaster, 2013/10/09