bug-coreutils
[Top][All Lists]
Advanced

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

Re: "ls" spacing between columns


From: Paul Eggert
Subject: Re: "ls" spacing between columns
Date: Sun, 11 Apr 2004 01:51:43 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

"Jordan Russell" <address@hidden> writes:

> I'm no expert either, but I certainly don't believe that format string is
> intended to be used literally.

It's intended to be read literally, _except_ that spaces in the format
string stand for one or more blanks in the output.  There's a special
character in the POSIX spec (which looks like a triangle) that's
intended to stand for a single literal space in the format.

Here's a URL describing this stuff in detail:

http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap05.html#tag_05

Incidently, the trailing space in typical "ls" modes that Jim
mentioned is part of what I think is a minor bug in the POSIX spec.
POSIX currently requires a blank after that trailing space, but
Solaris "ls" doesn't always have two spaces there.  I suspect this is
a bug in the POSIX spec, not a bug in Solaris "ls", but I haven't
gotten around to filing a bug report, and in the meantime GNU "ls"
always outputs two spaces.  Assuming that the POSIX spec is buggy, GNU
"ls" can be changed to omit the extra space when it isn't needed.  For
example, instead of this:

$ ls -ld /tmp
drwxrwxrwt  13 root root 8192 2004-04-11 01:48 /tmp

GNU "ls" could output this:

$ ls -ld /tmp
drwxrwxrwt 13 root root 8192 2004-04-11 01:48 /tmp




reply via email to

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