[TUHS] Command options and complexity

Greg 'groggy' Lehey grog at lemis.com
Fri Mar 13 14:25:27 AEST 2020


On Thursday, 12 March 2020 at 23:04:03 -0400, Doug McIlroy wrote:
>> -,: Make the option standard: output numbers with commas every 3 digits
>
> A terrible idea.

Yes, of course.  I don't think any of us meant these ideas seriously.
Was this the only objection you had?

> 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.)

In fact, at least FreeBSD sort -n handles the numbers quite happily.
I've tried it with 4.4BSD sort, which with a little coaxing builds
under FreeBSD.  It doesn't: it apparently sees the , as a delimiter.

The real question is whether a comma is a valid character in an
integer.  There are arguments that it should be.

Greg
--
Sent from my desktop computer.
Finger grog at lemis.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20200313/63160010/attachment.sig>


More information about the TUHS mailing list