The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Steffen Nurpmeso <steffen@sdaoden.eu>
To: Doug McIlroy <doug@cs.dartmouth.edu>
Cc: tuhs@tuhs.org
Subject: Re: [TUHS] Command options and complexity
Date: Fri, 13 Mar 2020 20:48:18 +0100	[thread overview]
Message-ID: <20200313194818.XS-yZ%steffen@sdaoden.eu> (raw)
In-Reply-To: <202003130304.02D343ok099975@tahoe.cs.Dartmouth.EDU>

Doug McIlroy wrote in
<202003130304.02D343ok099975@tahoe.cs.Dartmouth.EDU>:
 |> -,: Make the option standard: output numbers with commas every 3 digits
 |
 |A terrible idea. Whatever ls outputs should be easy for other
 |programs to read, and few know how to read commafied numbers.
 |As others have mentioned, this is also a strong argument for
 |changing the output representation of dates.
 |
 |I often do mailx -H | sort -t/ -k2nr to sort in reverse order of size--a
 |quick way to find the pay dirt when I want to shrink my mailbox.
 |This would never fly if the sizes had commas. (Well, I suppose I
 |could add sed s/,//g to the pipeline.)

It was not fully developed code why you need to do this with the
old mailx you use.  With v14.9.11 that is in Debian stable (it is
called s-nail there) and Ubuntu since "Disco Dingo" (i do not know
Ubuntu, but i seem to recall you said you were using it) that
becomes

  mailx -Sautosort=date -H [| tac]

for example.  But you could also use -L and do something like

  mailx -H -L '(larger 5000)'  # > 5000 bytes
  mailx -H -L '(before 1-Mar-2020)'
  mailx -H -L '(since 1-Mar-2020)'

or even go a batch approach (`search' == `from'):

  printf 'search "(before 1-Mar-2020)" # sh(1)ell quoting needed!
    move ` +elder # move the last selection to $folder/elder
    xit
  ' | mailx -Squiet -Snoheader

This can be improved further (-# batch mode, for example).
A lot of things are missing yet, however, these examples use IMAP
search expression syntax, a compile-time option.  No "regular"
approach to these things yet.

Anyway, that mailx is 4670 changesets ahead of what you use.  It
is unfortunately not the place, date and time to grouch about the
Debian punishment of small projects with fewest developers, the
latest release is 5554 ahead (and enters unstable; in testing
there is one that is 5204 changesets ahead).  These are _my_
changesets: with a Dr. Hipp Fossil versioning philosophie the
numbers could easily be doubled or tripled.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

      parent reply	other threads:[~2020-03-13 19:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13  3:04 Doug McIlroy
2020-03-13  4:25 ` Greg 'groggy' Lehey
2020-03-14  2:24   ` Greg A. Woods
2020-03-14 13:08     ` Richard Salz
2020-03-13 19:48 ` Steffen Nurpmeso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200313194818.XS-yZ%steffen@sdaoden.eu \
    --to=steffen@sdaoden.eu \
    --cc=doug@cs.dartmouth.edu \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).