Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #193155

Re: sort (-g) [offtopic]

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: sort (-g) [offtopic]
Date 2018-02-27 14:40 +0100
Message-ID <vnNE5-5zF-1@gated-at.bofh.it> (permalink)
References <vkzQZ-7kU-1@gated-at.bofh.it> <vkS7f-2rF-13@gated-at.bofh.it> <vnJqO-2Xo-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Feb 27, 2018 at 09:48:57AM +0100, Ionel Mugurel Ciobîcă wrote:
> # cat roman | msort -q -w -l -y ROMAN
> I
> II
> III
> IV
> IX
> V
> VI
> VII
> VIII
> X
> XI
> XII

> Did I miss anything?

Well, this program certainly is ... unusual.  Doesn't just *work* by
default.  No examples in the man page.  Anyway, it looks like you
forgot to specify numeric comparison.

wooledg:~$ printf %s\\n III IX IV V X VII VI VIII | msort -q -w -l -c N -y any
III
IV
V
VI
VII
VIII
IX
X

Here's what I mean by "doesn't just work by default":

wooledg:~$ printf %s\\n III IX IV V X VII VI VIII | msort -c N -y any
Comparison type specified without previous key selector (-e, -n, -t, or -w).

What, you don't just read lines by default?  And you don't take standard
sort(1)'s -k key specifier.  OK, fine, here's a -w for you:

wooledg:~$ printf %s\\n III IX IV V X VII VI VIII | msort -w -c N -y any
Sorting on whole record.
Increasing numeric string
Reading from stdin.
Records processed:                          0
There's no point in sorting fewer than two records.                            0

Lolwut?  Who came up with this user interface?  Do you even read standard
input by default?  No "standard" in the man page.  No "stdin" in the man
page.  No examples in the man page.  No default behavior that works.  OK,
I guess it does say "Reading from stdin" in that error output, but why
didn't you say that in the manual?  Jeez.

I ended up googling "msort example" which was only slightly helpful.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

sort (-g) [offtopic] Ionel Mugurel Ciobîcă <I.M.Ciobica@upcmail.nl> - 2018-02-18 17:20 +0100
  Re: sort (-g) [offtopic] <tomas@tuxteam.de> - 2018-02-18 17:50 +0100
  Re: sort (-g) [offtopic] David Wright <deblis@lionunicorn.co.uk> - 2018-02-18 21:50 +0100
    Re: sort (-g) [offtopic] John Hasler <jhasler@newsguy.com> - 2018-02-18 23:10 +0100
    Re: sort (-g) [offtopic] Ionel Mugurel Ciobîcă <I.M.Ciobica@upcmail.nl> - 2018-02-19 06:00 +0100
  Re: sort (-g) [offtopic] Will Mengarini <seldon@eskimo.com> - 2018-02-19 12:50 +0100
    Re: sort (-g) [offtopic] rhkramer@gmail.com - 2018-02-19 15:30 +0100
    Re: sort (-g) [offtopic] Ionel Mugurel Ciobîcă <I.M.Ciobica@upcmail.nl> - 2018-02-27 10:10 +0100
      Re: sort (-g) [offtopic] David Wright <deblis@lionunicorn.co.uk> - 2018-02-27 14:40 +0100
        Re: sort (-g) [offtopic] Ionel Mugurel Ciobîcă <I.M.Ciobica@upcmail.nl> - 2018-02-27 16:40 +0100
      Re: sort (-g) [offtopic] Greg Wooledge <wooledg@eeg.ccf.org> - 2018-02-27 14:40 +0100
        Re: sort (-g) [offtopic] Ionel Mugurel Ciobîcă <I.M.Ciobica@upcmail.nl> - 2018-02-27 16:20 +0100
  Re: sort (-g) [offtopic] Greg Wooledge <wooledg@eeg.ccf.org> - 2018-02-19 14:20 +0100

csiph-web