[Top][All Lists]

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

bug#17878: Possible bug in GNU ls with -R

From: fuz
Subject: bug#17878: Possible bug in GNU ls with -R
Date: Sun, 29 Jun 2014 20:06:30 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

I think I found behavior in GNU ls that deviates from the behavior
specified by POSIX.1 2008:

If GNU ls is called on one directory without subdirectories with the
option -R, it prints a directory heading like this:

    $ ls -RF
    foo  bar*  baz

POSIX.1 2008[1] says about this directory heading:

> If more than one directory, or a combination of non-directory files
> and directories are written, either as a result of specifying
> multiple operands, or the -R option, each list of files within a
> directory shall be preceded by:
>     "\n%s:\n", <directory name>
> If this string is the first thing to be written, the first <newline>
> shall not be written. This output shall precede the number of units
> in the directory.

In the case described above, ls writes a listing for one directory (.)
and does not list any non-directory files. Therefore, according to the
above specification, the ".:" heading may not be printed, but GNU ls
does do so. I suspect this is an oversight on the side of the
developers of the GNU coreutils.

I am using the following version of GNU ls:

    $ ls --version

    ls (GNU coreutils) 8.20
    Copyright (C) 2012 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later 
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    Written by Richard M. Stallman and David MacKenzie.

Thank you very much for your help.
Yours sincerely,
Robert Clausecker

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html

()  ascii ribbon campaign - for an 8-bit clean world 
/\  - against html email  - against proprietary attachments

reply via email to

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