-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Radu Grigore on 12/21/2008 12:14 PM: > The GNU coreutils documentation [1] suggests that "-1" and > "--format=single-column" are equivalent, yet the following two > commands produce different results: > ls -l -1 > ls -l --format=single-column > According to POSIX [2] both behaviors are correct (for "ls -l -1"), so > I guess you need to pick one or update the docs. > > [1] > http://www.gnu.org/software/coreutils/manual/html_node/General-output-formatting.html#General-output-formatting > [2] http://www.opengroup.org/onlinepubs/009695399/utilities/ls.html
Thanks for the report. FYI, POSIX 2008 is available: http://www.opengroup.org/onlinepubs/9699919799/utilities/ls.html but made no changes in this regard. POSIX requires that: ls -l ls -1 -l ls -l -1 behave identically (after all, a long listing is implicitly one-per-line); but makes no requirements on how long options behave. But we want to give the user to undo long listing, and get back to short listing. Using solely POSIX options, there is no way to disable -l once it has been added. Therefore, the current source code for ls uses - --format=single-column as the way to request overriding -l, then special cases -1 (but not --format) to not trigger --format=single-column if -l occurred earlier in the command line. So, since the code is intentional, the only way to solve this bug is with a doc update. > > tried with: coreutils package 6.10-3ubuntu2 The latest stable release is 6.12; you can also try beta 7.0. - -- Don't work too hard, make some time for fun as well! Eric Blake [email protected] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAklOqNsACgkQ84KuGfSFAYB2BACeJ2gDYrrPq6JiQM6r3JPJI9OJ SEIAoMX8/7V/Q9vrcoZdYDpvgnv1EvH+ =UVib -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
