On 28/10/15 17:01, Jim Meyering wrote: > On Wed, Oct 28, 2015 at 6:18 AM, Pádraig Brady <[email protected]> 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.
