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: Wed, 28 Oct 2015 17:30:04 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

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?

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

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

thanks,
Pádraig.



reply via email to

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