bug-coreutils
[Top][All Lists]
Advanced

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

bug#21325: ls : feature request --width=zero


From: Beco
Subject: bug#21325: ls : feature request --width=zero
Date: Sun, 23 Aug 2015 14:07:57 -0300

Good morning,

> From:Erik Auerswald, Date:Sun, 23 Aug 2015 15:00:32 +0200
>
> Hi,
> [...]
> Numbers between 32 bit SIZE_MAX and 64 bit SIZE_MAX will show
> differing behavior between 32 and 64 bit platforms (and data models).
> In practice this should be irrelevant, but it might result in very
> obscure failures. Explicitly setting the width to infinity, that is
> not adding any line breaks, avoides that.
> I would not consider 0 to be a valid width value, and the ls command
> agrees:

I was afraid that the core of the feature request was lost, thanks Erik to remind it.

It is indeed very different to say:
-w 18 quintillion => max 64 bits
or
-w 4 billion => max 32 bits
or
-w 0 => infinity any arch. (just not printing "\n")

Of course it is "practically" irrelevant (it would take 12 thousands years to list a directory in a line with 18 quintillion chars, 50 million chars per second). But I for myself don't like "theoretical" bugs inserted in code.

> [...]
> Beco's suggestion of 0 has precedent and seems
> more obvious to me than requiring a special keyword.

IMHO, -w0 reminds me old UNIX, and I like tradition. But whatever you say, I'm happy with; as long as it is infinity, not max.

For now, my ~/.bashrc holds:

---- ~/.bashrc ----
alias ll='ls -l'
alias la='ls -lah'
alias l.='ls -d * .*'
alias lm='ls -mw18446744073709551615'  #(or -w4294967295 for 32 bits systems)
---- end of cut ----

Also, just to give another option (brainstorming some food for tought), its is possible to consider -w without argument to be infinity.

$ ls -w -m

Man page: -w without arguments for no line breaks.

Anyway, just an idea. (I still vote for -w0 though).


> [...]
> Erik


Cheers,
Beco

PS. Sorry I could not cc Erik in the mail header; did not get the @.


--
Dr Beco
A.I. researcher

"I know you think you understand what you thought I said but I'm not sure you realize that what you heard is not what I meant" -- Alan Greenspan

GPG Key: https://pgp.mit.edu/pks/lookup?op=vindex&search=0x5A107A425102382A
Creation date: pgp.mit.edu ID as of 2014-11-09

reply via email to

[Prev in Thread] Current Thread [Next in Thread]