tech-userlevel archive

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

Re: Minor updates to sort ?



(Commenting in-line, not top-posting!)

On Sun, 29 May 2016, Robert Elz wrote:

   Date:        Sat, 28 May 2016 22:29:51 -0700
   From:        Alistair Crooks <agc%pkgsrc.org@localhost>
   Message-ID:  <CAN5gJXqdQR2Di0+RdH8esA+m9M5JohMW3WjkovCh-Q7O+Pjyow%mail.gmail.com@localhost>

 | Living on the edge and top posting aggresively, these changes would be good
 | to have.

I also agree - these are all good changes.

OK, but I will wait a day or two more to allow for more comments (or
more suggested improvements.)

I was asked (in off-list mail) to also add something to the manual about
how multiple -k args work.   This is more verbose that what was suggested...

(I made this off-list comment...)

    sort compares records by comparing the key fields selected by -k
    arguments, from first given to last, until discovering a difference.  If
    there are no -k arguments, the whole record is treated as the key.  After
    exhausting the -k arguments, if no difference has been found, then the
    result depends upon the -u and -S option settings.  With -u the records
    are considered identical, and one is supressed.  Otherwise with -s set
    (default) the records are left in their original order, or with -S (posix
    mode) the whole record is considered as a tie breaker.

Maybe update 2nd sentence?

	If there are no -k arguments, the whole record is treated as a
	single key.

I also (now) have (currently anyway) in the proposed updated man page, the
following commented text immediately after the paragraph above ...

.\"
.\" If you fail to understand why it doesn't matter which order
.\" the records are output when they are wholly identical, there
.\" is nothing that this man page can say that wll help!
.\"

(This is because there is a comment in the posix spec about this
being unspecified...)

Posix can be so helpful at times, and at other times, not so much ...



+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+


Home | Main Index | Thread Index | Old Index