coreutils
[Top][All Lists]
Advanced

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

Re: quoting of strings in errors


From: Pádraig Brady
Subject: Re: quoting of strings in errors
Date: Mon, 2 Nov 2015 14:33:34 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 28/10/15 18:19, Jim Meyering wrote:
> On Wed, Oct 28, 2015 at 10:30 AM, Pádraig Brady <address@hidden> wrote:
>> On 28/10/15 17:01, Jim Meyering wrote:
>>> On Wed, Oct 28, 2015 at 6:18 AM, Pádraig Brady <address@hidden> wrote:
>>>> seq 10 | shuf --random-source="blah"$'\r'
>>>
>>> Thank you for pursuing this.
>>> Properly quoting unusual names like those is definitely welcome,
>>
>> Cool. At least with this patch, the quoting is consistent across all utils.
>> I.E. we were already using quote() in most places.
>>
>>> however, in the remaining 99% of use cases, I find the added quotes
>>> to be most unwelcome: at least two extra bytes per line, in addition to
>>> the common hassles with multi-byte rendering.
>>>
>>> What do you think about a mode that quotes only when necessary?

Note one caveat with not using quotes by default, is it
might result in errors that are harder to understand.
For example the problematic item is not immediately
obvious in the following message:

  $ fname="file"
  $ fmt "$fname"
  fmt: cannot open file for reading: No such file or directory

By using shell_escape_always rather than shell_escape, we
still get the non multi-byte quoting and copy/paste benefits?

  $ fname="file"
  $ fmt "$fname"
  fmt: cannot open 'file' for reading: No such file or directory

What do you think?

cheers,
Pádraig.




reply via email to

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