Re: sort -c/C and last-resort sorting

2021-07-06 Thread Joerg Schilling via austin-group-l at The Open Group
Robert Elz wrote: > Date:Mon, 05 Jul 2021 20:05:20 +0200 > From:"Joerg Schilling via austin-group-l at The Open Group" > > Message-ID: <20210705180520.kgbgk%sch...@schily.net> > > | That would be in conflict with long existing practice > > Apparently not in

Re: sort -c/C and last-resort sorting

2021-07-06 Thread Robert Elz via austin-group-l at The Open Group
Date:Mon, 05 Jul 2021 20:05:20 +0200 From:"Joerg Schilling via austin-group-l at The Open Group" Message-ID: <20210705180520.kgbgk%sch...@schily.net> | That would be in conflict with long existing practice Apparently not in most versions of sort. | If you

Re: sort -c/C and last-resort sorting

2021-07-06 Thread Geoff Clare via austin-group-l at The Open Group
Joerg Schilling wrote, on 06 Jul 2021: > > "Geoff Clare via austin-group-l at The Open Group" > wrote: > > > > If you like to disable -s, better use +s > > > > That wouldn't be suitable for standardisation as it doesn't follow > > syntax guideline 4. The standard would need to use a different

Re: sort -c/C and last-resort sorting

2021-07-06 Thread Joerg Schilling via austin-group-l at The Open Group
"Geoff Clare via austin-group-l at The Open Group" wrote: > > If you like to disable -s, better use +s > > That wouldn't be suitable for standardisation as it doesn't follow > syntax guideline 4. The standard would need to use a different letter, > maybe -F for "fully sorted", or -l/-L for

Re: sort -c/C and last-resort sorting

2021-07-06 Thread Geoff Clare via austin-group-l at The Open Group
Joerg Schilling wrote, on 05 Jul 2021: > > "Robert Elz via austin-group-l at The Open Group" > wrote: > > > Date:Mon, 05 Jul 2021 18:04:59 +0200 > > From:"Joerg Schilling via austin-group-l at The Open Group" > > > > Message-ID:

Re: sort -c/C and last-resort sorting

2021-07-05 Thread Joerg Schilling via austin-group-l at The Open Group
"Robert Elz via austin-group-l at The Open Group" wrote: > Date:Mon, 05 Jul 2021 18:04:59 +0200 > From:"Joerg Schilling via austin-group-l at The Open Group" > > Message-ID: <20210705160459.e40cs%sch...@schily.net> > > | How do you believe is -S related to what

Re: sort -c/C and last-resort sorting

2021-07-05 Thread Robert Elz via austin-group-l at The Open Group
Date:Mon, 05 Jul 2021 18:04:59 +0200 From:"Joerg Schilling via austin-group-l at The Open Group" Message-ID: <20210705160459.e40cs%sch...@schily.net> | How do you believe is -S related to what -s could probably do? The -S under discussion is simply !-s (as -s is

Re: sort -c/C and last-resort sorting

2021-07-05 Thread Joerg Schilling via austin-group-l at The Open Group
"Stephane Chazelas via austin-group-l at The Open Group" wrote: > That's even more justification for adding -s to the standard > though so people can at least choose to get a stable sort > portably. -S could probably be added as well, but I don't think > it wise to make the default behaviour

Re: sort -c/C and last-resort sorting

2021-07-05 Thread Robert Elz via austin-group-l at The Open Group
Date:Mon, 5 Jul 2021 09:33:32 +0100 From:"Geoff Clare via austin-group-l at The Open Group" Message-ID: <20210705083332.GA21700@localhost> | If we add both -s and -S and specify "last one wins", That's what the NetBSD implementation does. kre

Re: sort -c/C and last-resort sorting

2021-07-05 Thread Geoff Clare via austin-group-l at The Open Group
Stephane Chazelas wrote, on 04 Jul 2021: > > That's even more justification for adding -s to the standard > though so people can at least choose to get a stable sort > portably. -S could probably be added as well, but I don't think > it wise to make the default behaviour unspecified. If we add

Re: sort -c/C and last-resort sorting

2021-07-04 Thread Robert Elz via austin-group-l at The Open Group
Date:Sun, 4 Jul 2021 10:31:06 +0100 From:Stephane Chazelas Message-ID: <20210704093106.2ce2cyg77f2nm...@chazelas.org> | That would make is non-compliant then. s/is/it/ ... and yes, so? | SUS> When there are multiple key fields, later keys shall be There was

Re: sort -c/C and last-resort sorting

2021-07-04 Thread Stephane Chazelas via austin-group-l at The Open Group
2021-07-04 15:47:55 +0700, Robert Elz via austin-group-l at The Open Group: [...] > which is the way it should be - if one has taken the trouble to specify > what parts of the record are the keys for sorting (and -u comparisons) > then sort should not be gratuitously adding more - that it used to

Re: sort -c/C and last-resort sorting

2021-07-04 Thread Stephane Chazelas via austin-group-l at The Open Group
2021-07-04 15:47:55 +0700, Robert Elz via austin-group-l at The Open Group: > Date:Fri, 2 Jul 2021 14:41:50 +0100 > From:"Geoff Clare via austin-group-l at The Open Group" > > Message-ID: <20210702134150.GB16587@localhost> > > | I've always assumed that the

Re: sort -c/C and last-resort sorting

2021-07-04 Thread Robert Elz via austin-group-l at The Open Group
Date:Fri, 2 Jul 2021 14:41:50 +0100 From:"Geoff Clare via austin-group-l at The Open Group" Message-ID: <20210702134150.GB16587@localhost> | I've always assumed that the intention for -c is to answer the | question "if I ran this command without -c would the

Re: sort -c/C and last-resort sorting

2021-07-02 Thread Stephane Chazelas via austin-group-l at The Open Group
2021-07-02 15:54:48 +0100, Geoff Clare via austin-group-l at The Open Group: > Joerg Schilling wrote, on 02 Jul 2021: > > > > > > > sort: -:2: disorder: a,a > > > > > > > > Try to use the POSIX sort variant to avoid the message. > > > [...] > > > > > > I suppose you mean the -C option, which > >

Re: sort -c/C and last-resort sorting

2021-07-02 Thread Joerg Schilling via austin-group-l at The Open Group
"Geoff Clare via austin-group-l at The Open Group" wrote: > > No, I was referring to /usr/xpg4/bin/sort > > That no longer exists in Solaris. If Illumos still has it they > should probably remove it (or make it a symlink to /usr/bin/sort). OK, I checked the source and the only difference

Re: sort -c/C and last-resort sorting

2021-07-02 Thread Geoff Clare via austin-group-l at The Open Group
Joerg Schilling wrote, on 02 Jul 2021: > > > > > sort: -:2: disorder: a,a > > > > > > Try to use the POSIX sort variant to avoid the message. > > [...] > > > > I suppose you mean the -C option, which > > still checks but doesn't output a diagnostics message. > > No, I was referring to

Re: sort -c/C and last-resort sorting

2021-07-02 Thread Joerg Schilling via austin-group-l at The Open Group
Stephane Chazelas wrote: > 2021-07-02 14:07:17 +0200, Joerg Schilling via austin-group-l at The Open > Group: > > "Stephane Chazelas via austin-group-l at The Open Group" > > wrote: > > > > > Is: > > > > > > printf '%s\n' a,b a,a | sort -c -t, -k1,1 > > > > > > Meant to succeed or not? > >

Re: sort -c/C and last-resort sorting

2021-07-02 Thread Geoff Clare via austin-group-l at The Open Group
Stephane Chazelas wrote, on 02 Jul 2021: > > btw, it seems to me -C should be referenced in the EXIT STATUS > section and in the -u description like for -c. Yes, also in STDOUT. -- Geoff Clare The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England

Re: sort -c/C and last-resort sorting

2021-07-02 Thread Stephane Chazelas via austin-group-l at The Open Group
2021-07-02 14:07:17 +0200, Joerg Schilling via austin-group-l at The Open Group: > "Stephane Chazelas via austin-group-l at The Open Group" > wrote: > > > Is: > > > > printf '%s\n' a,b a,a | sort -c -t, -k1,1 > > > > Meant to succeed or not? > > > > It fails in GNU, busybox, OpenBSD,

Re: sort -c/C and last-resort sorting

2021-07-02 Thread Geoff Clare via austin-group-l at The Open Group
Stephane Chazelas wrote, on 02 Jul 2021: > > Is: > > printf '%s\n' a,b a,a | sort -c -t, -k1,1 > > Meant to succeed or not? > > It fails in GNU, busybox, OpenBSD, FreeBSD, Solaris, though with a > confusing: > > sort: -:2: disorder: a,a > > diagnostic and succeeds in NetBSD. > > It succeeds

Re: sort -c/C and last-resort sorting

2021-07-02 Thread Joerg Schilling via austin-group-l at The Open Group
"Stephane Chazelas via austin-group-l at The Open Group" wrote: > Is: > > printf '%s\n' a,b a,a | sort -c -t, -k1,1 > > Meant to succeed or not? > > It fails in GNU, busybox, OpenBSD, FreeBSD, Solaris, though with a > confusing: > > sort: -:2: disorder: a,a Try to use the POSIX sort

sort -c/C and last-resort sorting

2021-07-02 Thread Stephane Chazelas via austin-group-l at The Open Group
Is: printf '%s\n' a,b a,a | sort -c -t, -k1,1 Meant to succeed or not? It fails in GNU, busybox, OpenBSD, FreeBSD, Solaris, though with a confusing: sort: -:2: disorder: a,a diagnostic and succeeds in NetBSD. It succeeds with -s in all implementations that support that flag (all but Solaris