bug-coreutils
[Top][All Lists]
Advanced

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

bug#19218: Inconsistent spacing of output of "ls --full-time [file argum


From: Pádraig Brady
Subject: bug#19218: Inconsistent spacing of output of "ls --full-time [file argument]"
Date: Sun, 30 Nov 2014 02:09:19 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

tag 19218 notabug
close 19218
stop

On 29/11/14 21:14, Paul Eggert wrote:
> I don't see a bug in the cases you mention.  First, 'ls' dynamically adjusts 
> column widths to fit the data, and this is considered to be a feature.

Right. This is a limitation of cut, rather than anything wrong with ls.
See the awk usage at http://www.gnu.org/software/coreutils/cut

These examples might help:

  ls --full-time | tr -s ' ' | cut -d' ' -f6-
  ls --full-time | awk '{ print substr($0, index($0,$6)) }'

> Second, different platforms have different time stamp resolutions.  The idea 
> that
> all dates should use the same width is doomed anyway, since file time stamps 
> can 
> exceed the year 9999:
> 
> $ touch -d'10000-01-01 00:00:00' far-in-future
> $ touch now
> $ ls -l --full-time
> -rw-r--r-- 1 eggert eggert 0 10000-01-01 00:00:00.000000000 -0800 
> far-in-future
> -rw-r--r-- 1 eggert eggert 0 2014-11-29 13:07:55.182466680 -0800 now
> 
> Arguably this last example *is* a bug in 'ls', as dates should line up even 
> when 
> they're outlandish.  But it's not likely to be a bug one runs into with real 
> files, at least, not for another 7985 years or so.

:)

thanks,
Pádraig.






reply via email to

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