coreutils
[Top][All Lists]
Advanced

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

Re: ls quoting improvements


From: Pádraig Brady
Subject: Re: ls quoting improvements
Date: Thu, 21 Jan 2016 20:20:16 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 21/01/16 19:25, Mike Frysinger wrote:
> in cases where the filename has a single quote in it, and no other
> expandable chars (like $ or `), would it be better to use double
> quotes to quote the output ?
> 
> for example, i have a file like:
>       My Sister's stuff.xls
> 
> the new ls quote behavior shows it like:
>       'My Sister'\''s stuff.xls'
> 
> double quotes would be nicer:
>       "My Sister's stuff.xls"

Yes that would be a bit better,
though then you have to worry about what's special
within double quotes and that varies between shells.

Also one has the option to use the preferred char
for an apostrophe ’ (AltGr+0 on my keyboard),
avoiding shell meta chars in file names. I.E.:

  'My Sister’s stuff.xls'

> on a related note, how do you turn this off ?  the `ls --help` only
> shows ways to turn it on, and i don't see options from a quick scan
> of the ls.c code.

  export QUOTING_STYLE=literal

or

  ls -N

cheers,
Pádraig.



reply via email to

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