Bug 1349701 - Disable quoting file name behavior of ls command in coreutils-8.25
Summary: Disable quoting file name behavior of ls command in coreutils-8.25
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
: 1352691 1361694 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-24 04:09 UTC by LiuYan
Modified: 2016-08-01 07:31 UTC (History)
9 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2016-06-24 08:52:40 UTC


Attachments (Terms of Use)

Description LiuYan 2016-06-24 04:09:56 UTC
Description of problem:
  `ls` command now quote file name if there're spaces or special characters (such as single quote)

  example:
  -------------------------------
  # ls /hdd/VirtualBox\ VMs -d
  '/hdd/VirtualBox VMs'
  -------------------------------

Version-Release number of selected component (if applicable):
  8.25-5.fc24 (perhaps started from 8.25)

How reproducible:
  Always


Steps to Reproduce:
  1. ls a file/directory name with whitespaces or single quotes

Actual results:
  File name with whitespaces are quoted with single quote

Expected results:
  Output the original file name without quoting

Additional info:
  I found a QA thread: http://unix.stackexchange.com/questions/258679/why-is-ls-suddenly-wrapping-items-with-spaces-in-single-quotes
  As L Spice commented in the above QA thread, `export QUOTING_STYLE=literal` should do the trick

  Some useful links:
  http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blobdiff;f=src/ls.c;h=2ae548d996b236660c6cea10293a31c674c21f01;hp=c22c536c04731ff25c9cb265c2e8e7952381f4ad;hb=109b9220cead6e979d22d16327c4d9f8350431cc;hpb=5ef08864113505c6392158c9fac9a6cb1b3ac0e6
  http://lists.gnu.org/archive/html/coreutils/2016-02/msg00000.html

Comment 1 Kamil Dudka 2016-06-24 08:52:40 UTC
The behavior was intentionally changed by upstream.  The change in behavior is properly documented in /usr/share/doc/coreutils-common/NEWS:

  ls now quotes file names unambiguously and appropriate for use in a shell,
  when outputting to a terminal.

If you think the change was a bad idea, please explain your reasoning at the bug-coreutils mailing list.  In any case, we are not going to diverge from upstream in the default behavior of ls.

Comment 2 Pádraig Brady 2016-07-04 20:21:22 UTC
*** Bug 1352691 has been marked as a duplicate of this bug. ***

Comment 3 Kamil Dudka 2016-07-29 20:54:22 UTC
*** Bug 1361694 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.