From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 29 14:11:43 2014 Received: (at submit) by debbugs.gnu.org; 29 Nov 2014 19:11:43 +0000 Received: from localhost ([127.0.0.1]:49374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XunQk-0001Rg-5q for submit@debbugs.gnu.org; Sat, 29 Nov 2014 14:11:43 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47122) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xuibn-0002TC-KP for submit@debbugs.gnu.org; Sat, 29 Nov 2014 09:02:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xuibh-0008ET-Nn for submit@debbugs.gnu.org; Sat, 29 Nov 2014 09:02:47 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xuibh-0008EP-LW for submit@debbugs.gnu.org; Sat, 29 Nov 2014 09:02:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xuibc-0004br-9V for bug-coreutils@gnu.org; Sat, 29 Nov 2014 09:02:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuibV-00086Z-3s for bug-coreutils@gnu.org; Sat, 29 Nov 2014 09:02:36 -0500 Received: from outbound-queue-1.mail.thdo.gradwell.net ([212.11.70.34]:46364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuibU-00085s-TC for bug-coreutils@gnu.org; Sat, 29 Nov 2014 09:02:29 -0500 Received: from outbound-edge-2.mail.thdo.gradwell.net (bonnie.gradwell.net [212.11.70.2]) by outbound-queue-1.mail.thdo.gradwell.net (Postfix) with ESMTP id 2B0C521F17 for ; Sat, 29 Nov 2014 14:02:27 +0000 (GMT) Received: from michaels.gotadsl.co.uk (HELO [192.168.173.11]) (213.208.107.91) (smtp-auth username mirror%pop3.baugrundp.com, mechanism cram-md5) by outbound-edge-2.mail.thdo.gradwell.net (qpsmtpd/0.83) with ESMTPA; Sat, 29 Nov 2014 14:02:27 +0000 From: "Michael Salem" Organization: MSC To: bug-coreutils@gnu.org Date: Sat, 29 Nov 2014 14:02:28 +0000 MIME-Version: 1.0 Subject: Inconsistent spacing of output of "ls --full-time [file argument]" Message-ID: <5479D1F4.23480.EAA6332@mgs.michaels.demon.co.uk> Priority: normal X-mailer: Pegasus Mail for Windows (4.70) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Gradwell-MongoId: 5479d1f3.2b0-20f2-2 X-Gradwell-Auth-Method: mailbox X-Gradwell-Auth-Credentials: mirror@pop3.baugrundp.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 29 Nov 2014 14:11:40 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: michaels@michaels.demon.co.uk List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Summary: the output format of "ls --full-time" with a file argument seems to be inconsistent (within the same version of ls) for different arguments. I have either a question, or a bug report. on ls. The question: is the output of ls --full-time intended to be consistent within one version of ls? I was trying to use it to extract file timestamps using "cut", and was finding that for different file arguments the output was different, and there was no unique way to extract the timestamp. This always with the sane version of ls; different versions have significantly different output spacing, which is just the way it is, not a problem. If the answer is "the horizontal spacing is not specified and not consistent", I express criticism, but say no more. Otherwise, I have found what appears to be a consistent bug in several versions of ls, both in Linux and three different versioned Windows ports. In the first cases I tested there was an extra space character in the output depending upon the file argument. I later found, but did not investigate further, MAJOR differences in spacing in output from the Linux 8.21 version (examples below, look for pam.conf). The problem manifests in the same way in "ls" in (GNU coreutils) 8.21 in Linux Mint, ls 4.4.231 from the UnxUtils Windows port; ls 5.3.0 from GnuWin32; and ls 4.5.287 for Windows from https://u-tools.com/msls.asp. It is the no surprise that the horizontal output spacing of DIFFERENT versions are different from each other; but within EACH SINGLE version they all omit a space before the file size for some, but not all, file arguments with the --full-time option. (I first discovered the variability using "cut" to process the output, finding that what worked for a full listing didn't work in some other cases). I also found an example of much worse variability in 8.21 Gnu. This last variability is so great that I would say that the output from "ls --full-time" is essentially randomly, unpredictably spaced, unsuitable for piping. Or have I misunderstood something? In all cases I invoked, for files in the working directory, ls --full-time [file argument without path] In Windows (with cut.exe in the working directory) I used file arguments cut.exe, c*.exe *.exe, and no argument (all files). In Linux I worked in the bin directory, and used file arguments cut, c*, *, and no argument. With the more restrictive argument all the lines of output had one less space before the file size. I don't know exactly what happens; in Windows cut.exe, c*.exe came out one way, *.exe, and no argument the other. At least in the Windows versions there were no tab characters, only spaces; this isn't a tab spacing issue. (I later found much worse in the Linux /etc directory, see examples.) Anyway, astonishing as it sounds, there may be a very long-standing bug in something as basic as ls. All examples given are generated by "ls --fulltime [argument] > report" and copied and pasted, not hand-copied; they contained no tab characters. SAMPLES OF INCONSISTENT OUTPUT FROM ls --full-time -------------------------------------------------- (Lines contain no unexpected hard breaks; visibly broken lines are due to viewer and transmission issues.) MS Windows ---------- ls 5.3.0 ls --full-time (with no argument; same for ls --full-time *.exe) ... -rw-rw-rw- 1 Michael 0 0 2014-11-29 12:28:00.000000000 +0000 cccc.txt -rwxrwxrwx 1 Michael 0 17920 2003-06-20 16:57:42.000000000 +0100 cut.exe ... ls --full-time cut.exe (same for c*.exe) -rwxrwxrwx 1 Michael 0 17920 2003-06-20 16:57:42.000000000 +0100 cut.exe ls 4.4.231 and 4.5.287 ls --full-time (with no argument; same layout for ls --full-time *.exe) -rw-rw-rwa 1 Everyone 0 2014-11-29 12:28:00 cccc.txt -rwxrwxrwa 1 Everyone 17920 2003-06-20 16:57:42 cut.exe ls --full-time cut.exe (same for c*.exe) -rwxrwxrwa 1 Everyone 17920 2003-06-20 16:57:42 cut.exe Linux Mint, ls 8.21 ---------- /bin directory ... -rwxr-xr-x 1 root root 124932 2014-03-24 07:37:58.000000000 +0000 cp -rwxr-xr-x 1 root root 138900 2013-06-02 13:07:47.000000000 +0100 cpio ... ls --full-time cp (same layout with c*) ... -rwxr-xr-x 1 root root 124932 2014-03-24 07:37:58.000000000 +0000 cp -rwxr-xr-x 1 root root 138900 2013-06-02 13:07:47.000000000 +0100 cpio ... /etc directory - MASSIVE variability found here. The output contained no tab characters - this is not an issue of tab expansion ls --full-time (with no argument) ... -rw-r--r-- 1 root root 249 2014-07-22 16:34:41.000000000 +0100 os-release -rw-r--r-- 1 root root 552 2014-01-31 22:19:46.000000000 +0000 pam.conf ... ls --full-time pam.conf -rw-r--r-- 1 root root 552 2014-01-31 22:19:46.000000000 +0000 pam.conf In case the spacing gets messed up by the display software, I append four lines, repeated from the Linux examples, with spaces globally replaced by underlines. i consider that the first two should be identical to each other, as should the last two. -rwxr-xr-x_1_root_root__124932_2014-03-24_07:37:58.000000000_+0000_cp -rwxr-xr-x_1_root_root_124932_2014-03-24_07:37:58.000000000_+0000_cp -rw-r--r--__1_root____root______552_2014-01-31_22:19:46.000000000_+000 0_pam.conf -rw-r--r--_1_root_root_552_2014-01-31_22:19:46.000000000_+0000_pam.con f I don't know how communication is handled; this email is sent with a legitimate email address, hopefully not for publication. I'm not subscribed to the list, but mail will also reach me for the time being at the temporary address 8ec94ac4@opayq.com. Text is not ideal and lines break, but I don't know if attaching a file is supported. Best wishes, Michael Salem From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 29 15:53:19 2014 Received: (at 19218) by debbugs.gnu.org; 29 Nov 2014 20:53:19 +0000 Received: from localhost ([127.0.0.1]:49425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xup14-00041E-TK for submit@debbugs.gnu.org; Sat, 29 Nov 2014 15:53:19 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:34293) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xup12-000413-A4 for 19218@debbugs.gnu.org; Sat, 29 Nov 2014 15:53:17 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3jqlKR0D5kz3hjZQ; Sat, 29 Nov 2014 21:53:14 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3jqlKQ5wwZzvh2Y; Sat, 29 Nov 2014 21:53:14 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id 4Ld0HgEH2Pgl; Sat, 29 Nov 2014 21:53:14 +0100 (CET) X-Auth-Info: b9nF5DVHaGs0nZSO+1CihmmRFiIESK/u1wlt89YQLjSnffPfuKnhY1VyheSuX8IL Received: from igel.home (ppp-188-174-145-11.dynamic.mnet-online.de [188.174.145.11]) by mail.mnet-online.de (Postfix) with ESMTPA; Sat, 29 Nov 2014 21:53:14 +0100 (CET) Received: by igel.home (Postfix, from userid 1000) id E241A2C18C8; Sat, 29 Nov 2014 21:53:13 +0100 (CET) From: Andreas Schwab To: "Michael Salem" Subject: Re: bug#19218: Inconsistent spacing of output of "ls --full-time [file argument]" References: <5479D1F4.23480.EAA6332@mgs.michaels.demon.co.uk> X-Yow: Someone is DROOLING on my collar!! Date: Sat, 29 Nov 2014 21:53:13 +0100 In-Reply-To: <5479D1F4.23480.EAA6332@mgs.michaels.demon.co.uk> (Michael Salem's message of "Sat, 29 Nov 2014 14:02:28 +0000") Message-ID: <87k32du3t2.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19218 Cc: 19218@debbugs.gnu.org, michaels@michaels.demon.co.uk X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) "Michael Salem" writes: > I was trying to use it to extract file timestamps using "cut", Don't do that. Use stat(1) instead. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 29 16:14:52 2014 Received: (at 19218) by debbugs.gnu.org; 29 Nov 2014 21:14:52 +0000 Received: from localhost ([127.0.0.1]:49430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XupLv-0004Xi-Vs for submit@debbugs.gnu.org; Sat, 29 Nov 2014 16:14:52 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:40008) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XupLu-0004XY-96 for 19218@debbugs.gnu.org; Sat, 29 Nov 2014 16:14:50 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 17E2B39E8016; Sat, 29 Nov 2014 13:14:49 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uw02yJuUcdXY; Sat, 29 Nov 2014 13:14:40 -0800 (PST) Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net [71.177.17.123]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 2E31239E8015; Sat, 29 Nov 2014 13:14:40 -0800 (PST) Message-ID: <547A3739.2070404@cs.ucla.edu> Date: Sat, 29 Nov 2014 13:14:33 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: michaels@michaels.demon.co.uk, 19218@debbugs.gnu.org Subject: Re: bug#19218: Inconsistent spacing of output of "ls --full-time [file argument]" References: <5479D1F4.23480.EAA6332@mgs.michaels.demon.co.uk> In-Reply-To: <5479D1F4.23480.EAA6332@mgs.michaels.demon.co.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19218 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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. 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. > this email is sent with a > legitimate email address, hopefully not for publication. GNU bug reports are public, I'm afraid. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 29 19:50:53 2014 Received: (at 19218) by debbugs.gnu.org; 30 Nov 2014 00:50:53 +0000 Received: from localhost ([127.0.0.1]:49471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xusiy-0003Hu-HB for submit@debbugs.gnu.org; Sat, 29 Nov 2014 19:50:53 -0500 Received: from outbound-queue-2.mail.thdo.gradwell.net ([212.11.70.35]:46939) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XusVJ-0002lt-CK for 19218@debbugs.gnu.org; Sat, 29 Nov 2014 19:36:46 -0500 Received: from outbound-edge-2.mail.thdo.gradwell.net (bonnie.gradwell.net [212.11.70.2]) by outbound-queue-2.mail.thdo.gradwell.net (Postfix) with ESMTP id 6CB042373B for <19218@debbugs.gnu.org>; Sun, 30 Nov 2014 00:36:44 +0000 (GMT) Received: from michaels.gotadsl.co.uk (HELO [192.168.173.11]) (213.208.107.91) (smtp-auth username mirror%pop3.baugrundp.com, mechanism cram-md5) by outbound-edge-2.mail.thdo.gradwell.net (qpsmtpd/0.83) with ESMTPA; Sun, 30 Nov 2014 00:36:44 +0000 From: "Michael Salem" Organization: MSC To: 19218@debbugs.gnu.org Date: Sun, 30 Nov 2014 00:36:46 +0000 MIME-Version: 1.0 Subject: Re: bug#19218: Inconsistent spacing of output of "ls --full-time [file argument]" Message-ID: <547A669E.379.10EF1BF1@michaels.michaels.demon.co.uk> Priority: normal X-mailer: Pegasus Mail for Windows (4.70) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Gradwell-MongoId: 547a669c.8a4c-4088-2 X-Gradwell-Auth-Method: mailbox X-Gradwell-Auth-Credentials: mirror@pop3.baugrundp.com X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19218 X-Mailman-Approved-At: Sat, 29 Nov 2014 19:50:49 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: mgs@michaels.demon.co.uk List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Thanks for response to my bug report. I'm not familiar with this tracking system, and hope the response is organised right, threading appropriately without too much duplication or long-windedness (I won;t quote massively in detail). I reported an issue whereby several versions of ls all manifested what I describe as inappropriate behaviour when used with the --full-time option. This made ls inappropriate for my purpose, using cut to extract parts of the line. I gave specific examples where ls --full-time gave different results on the same directory at the same time for different file arguments producing the same output line plus others (cp, cp*, c*, no argument). BTW, I don't actually have a problem to resolve any more, my report was simply for information (I have used stat, and finally ended up writing and compiling a simple program). > Andreas Shcwab kindly suggested that ls is the wrong tool, recommending stat. That is absolutely right, and I had later been using stat (which happened not to be available to me originally, but I learnt about it later) after giving up on ls. > Paul Eggert says "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. Second, different platforms have different time stamp resolutions." This clarifies matters for me, and I now agree insofar as one can't expect ls to produce the same output in all circumstances (though it's perhaps reasonable to expect it to be consistent ON THE SAME PLATFORM and using the same version, just needing small script changes if using "cut" to extract subtrings on different platforms). However, I maintain that the behaviour I described, and repeat below, is bad enough to be called a bug. Whether it's considered worth correcting is another matter, which I won't push. ls --full-time on the SAME file on the SAME directory at the SAME time (within a couple of minutes) produces differently-formatted output depending upon the file argument. The copied and pasted example I gave illustarted this. I gave several examples in my original posting (which can be referred to if redundant examples are wanted), but one blatant one is enough, with ls 8.21, Linux Mint, /etc directory. In the following I've replaced each space by an underline; the output continaed no "real" underlines or tab characters. This is a particularly bad example, but many others produced output differing by one space between using a full filename or no argument. (In /etc try cp, no argumjent, c*.) ls --full-time (with no argument) produces, amongst other lines: -rw-r--r--__1_root____root______552_2014-01-31_22:19:46.000000000_+000 0_pam.conf ls --full-time pam.conf produces: -rw-r--r--_1_root_root_552_2014-01-31_22:19:46.000000000_+0000_pam.con f There is NO WAY that this is anything other than a bug. Maybe not worth fixing though? I repeat, ls --full-time on the SAME file on the SAME directory at the SAME time on the SAME platform with the SAME ls version produces significantly differently-spaced output formats (the actual non-space content is identical, as expected) Best wishes, Michael Salem From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 29 21:09:32 2014 Received: (at 19218) by debbugs.gnu.org; 30 Nov 2014 02:09:32 +0000 Received: from localhost ([127.0.0.1]:49484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xutx5-0005uQ-V7 for submit@debbugs.gnu.org; Sat, 29 Nov 2014 21:09:32 -0500 Received: from mail2.vodafone.ie ([213.233.128.44]:22891) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xutwz-0005ty-K7; Sat, 29 Nov 2014 21:09:26 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjkJAJB7elRtTnMX/2dsb2JhbABbgwZRWYMExBOGSwECAoEKFgEBAQEBfYQCAQEBAwEjDwFLCwsNCwICBRYLAgIJAwIBAgFFBwwIAQEFiC4NAQi8PYV+j0QBCyCBLo0Ggk6CdYFTBaQ/jUuCN4FEP4J3AQEB Received: from unknown (HELO localhost.localdomain) ([109.78.115.23]) by mail2.vodafone.ie with ESMTP; 30 Nov 2014 02:09:20 +0000 Message-ID: <547A7C4F.2000807@draigBrady.com> Date: Sun, 30 Nov 2014 02:09:19 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: michaels@michaels.demon.co.uk, 19218@debbugs.gnu.org Subject: Re: bug#19218: Inconsistent spacing of output of "ls --full-time [file argument]" References: <5479D1F4.23480.EAA6332@mgs.michaels.demon.co.uk> <547A3739.2070404@cs.ucla.edu> In-Reply-To: <547A3739.2070404@cs.ucla.edu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 19218 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.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. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 29 23:42:31 2014 Received: (at 19218) by debbugs.gnu.org; 30 Nov 2014 04:42:31 +0000 Received: from localhost ([127.0.0.1]:49507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XuwL8-0002qc-Md for submit@debbugs.gnu.org; Sat, 29 Nov 2014 23:42:30 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:52406) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XuwL6-0002qT-Pi for 19218@debbugs.gnu.org; Sat, 29 Nov 2014 23:42:29 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 52BC4A60016; Sat, 29 Nov 2014 20:42:27 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6-m7ibS2uCpm; Sat, 29 Nov 2014 20:42:18 -0800 (PST) Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net [71.177.17.123]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 6E46C39E801D; Sat, 29 Nov 2014 20:42:18 -0800 (PST) Message-ID: <547AA029.9060203@cs.ucla.edu> Date: Sat, 29 Nov 2014 20:42:17 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: mgs@michaels.demon.co.uk, 19218@debbugs.gnu.org Subject: Re: bug#19218: Inconsistent spacing of output of "ls --full-time [file argument]" References: <5479D1F4.23480.EAA6332@mgs.michaels.demon.co.uk> <547A669E.379.10EF1BF1@michaels.michaels.demon.co.uk> In-Reply-To: <547A669E.379.10EF1BF1@michaels.michaels.demon.co.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 19218 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Michael Salem wrote: > There is NO WAY that this is anything other than a bug. It's not a bug. The first listing produces several lines of output, with wider columns, enough to accommodate every entry in every row. The second listing does the same with just one line of output, so the columns can be narrower. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 03 07:49:05 2014 Received: (at 19218) by debbugs.gnu.org; 3 Dec 2014 12:49:05 +0000 Received: from localhost ([127.0.0.1]:52369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xw9Me-0007z9-Ve for submit@debbugs.gnu.org; Wed, 03 Dec 2014 07:49:05 -0500 Received: from outbound-queue-1.mail.thdo.gradwell.net ([212.11.70.34]:46366) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xw9Mc-0007yz-Kl for 19218@debbugs.gnu.org; Wed, 03 Dec 2014 07:49:03 -0500 Received: from outbound-edge-2.mail.thdo.gradwell.net (bonnie.gradwell.net [212.11.70.2]) by outbound-queue-1.mail.thdo.gradwell.net (Postfix) with ESMTP id CE87121F22 for <19218@debbugs.gnu.org>; Wed, 3 Dec 2014 12:49:01 +0000 (GMT) Received: from michaels.gotadsl.co.uk (HELO [192.168.173.11]) (213.208.107.91) (smtp-auth username mirror%pop3.baugrundp.com, mechanism cram-md5) by outbound-edge-2.mail.thdo.gradwell.net (qpsmtpd/0.83) with ESMTPA; Wed, 03 Dec 2014 12:49:01 +0000 From: "Michael Salem" Organization: MSC To: 19218@debbugs.gnu.org Date: Wed, 03 Dec 2014 12:49:02 +0000 MIME-Version: 1.0 Subject: Re: bug#19218: Inconsistent spacing of output of "ls --full-time [file argument]" Message-ID: <547F06BE.22952.7618FE6@mgs.michaels.demon.co.uk> Priority: normal X-mailer: Pegasus Mail for Windows (4.70) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Gradwell-MongoId: 547f06bd.1401a-58ff-2 X-Gradwell-Auth-Method: mailbox X-Gradwell-Auth-Credentials: mirror@pop3.baugrundp.com X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19218 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: michaels@michaels.demon.co.uk List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) To wrap up: I reported inconsistent output format from ls as a bug; others have made informative comments, to the effect that the output format of ls is not specified in detail so there is no program error; it is user error. I think the essential points are, going from the general to the particular: 1. Don't rely on undocumented behaviour in general. 2. If you do rely on undocumented output format, you're less likely to have trouble using whitespace as a delimiter rather than rely on absolute character positions. (In my particular case whitespace would have been OK, although it's been pointed out that ls date format, which I was assuming, is not guaranteed anyway, and ls is not the appropriate tool.) 3. The output format of ls depends upon its content, in particular it adjusts the lengths of all lines according to the longest one, so it is not incorrect for runs of ls which would produce overlong lines to eliminate some space characters. Thus, the line for file cp in /etc, in the output of can legitimately be spaced differently than for a listing of all the files in the directory, some of them with long names. I wouldn't have distributed a script like the one I was trying to use without more care, but had thought it would be safe when using the same version of ls on the same system, and always in the same directory! Thanks to all, and I hope this conversation might be of use to anyone repeating my mistake. From unknown Thu Jun 19 16:24:11 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 01 Jan 2015 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator