coreutils
[Top][All Lists]
Advanced

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

Re: RFC: ls default escaping


From: Pádraig Brady
Subject: Re: RFC: ls default escaping
Date: Tue, 3 Nov 2015 16:56:58 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 03/11/15 14:57, Jim Meyering wrote:
> On Tue, Nov 3, 2015 at 5:53 AM, Pádraig Brady <address@hidden> wrote:
>> I noticed in the info docs that ls may change to "shell" quoting by default.
>>
>>   "You can specify the default value of the ‘--quoting-style’ option
>>    with the environment variable ‘QUOTING_STYLE’.  If that environment
>>    variable is not set, the default value is ‘literal’, but this
>>    default may change to ‘shell’ in a future version of this package."
>>
>> Given the new support for "shell-escape" quoting which provides
>> both a concise and unambiguous output, should we now consider
>> enabling that by default?
>>
>> $ touch '1 2' 3 $'4\r'
>> $ ls-old
>> 1 2  3  4?
>> $ ls-new
>> '1 2'  3  '4'$'\r'
> 
> Yes, please.
> Those question marks struck me as anachronistic 10 years ago.

Patch attached.

Note I've not changed it when piping as that's probably not wanted
and pretty much guaranteed to break scripts in the presence of
any names requiring quoting. I.E. anything like:

  ls -rt | while read file; process "$file"; done

cheers,
Pádraig

Attachment: ls-tty-shell-escape.patch
Description: Text Data


reply via email to

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