Bug 1349701

Summary: Disable quoting file name behavior of ls command in coreutils-8.25
Product: [Fedora] Fedora Reporter: LiuYan <lovetide>
Component: coreutilsAssignee: Kamil Dudka <kdudka>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 24CC: admiller, jamartis, kdudka, kzak, ooprala, ovasik, p, shamim.islam, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-24 08:52:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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. ***