coreutils
[Top][All Lists]
Advanced

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

Re: quoting of strings in errors


From: Jim Meyering
Subject: Re: quoting of strings in errors
Date: Wed, 28 Oct 2015 11:19:39 -0700

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?
>
> What about distinguishing file names which account for many of these?
> I.E. have quote_name() use "shell-escaped" quoting by default,
> which would mean easier copy and pasting?

I like it.

> You could also enhance the shell-escaped quoting to support $'\r' etc.
> for full support to copy and pasting.
> For details on $'' format, see Stehpane Chazelas' discussion at:
> http://thread.gmane.org/gmane.comp.standards.posix.austin.general/10289

I read that and agree with Stéphane.

> As an aside, perhaps printf %q support could be part of this too.

Makes sense.



reply via email to

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