public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] How to stop ls from quoting output
@ 2016-05-03 17:07 Daniel Quinn
  2016-05-03 17:08 ` parazyd
  2016-05-04 14:39 ` [gentoo-user] " Nikos Chantziaras
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Quinn @ 2016-05-03 17:07 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1030 bytes --]

Some time ago after an update |ls| started returning output that looked
like this:

|8hOk25T.jpg 'Janeway Wallpaper-iPhone.png' 'Screenshot from 2016-04-06
16-15-15.png' microsoft.png 'Away mission Wallpaper-iPhone.png'
'Screenshot from 2016-03-18 14-29-06.png' 'Screenshot from 2016-04-07
11-29-02.png' gcal.png |

Note that some of the files have a single quote (‘) surrounding them,
and others don’t. I understand that this makes things easier to do stuff
like

|for f in $(ls /path/to/whatever); do something; fi |

But since I do that a lot less than I just do this:

|ls -l |

I’d like to revert to the old way so my eye isn’t jumping left & right
all the time.

I see that I can just write an alias:

|alias ls="ls --quoting-style=literal" |

But I’d hate to do that if the default is “literal” and there’s some
config installed somewhere that’s changing this. Does anyone have some
information regarding whether this is a new default upstream or if a
Gentoo package was somehow modified to do this?

​

[-- Attachment #2: Type: text/html, Size: 5990 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] How to stop ls from quoting output
  2016-05-03 17:07 [gentoo-user] How to stop ls from quoting output Daniel Quinn
@ 2016-05-03 17:08 ` parazyd
  2016-05-04 14:39 ` [gentoo-user] " Nikos Chantziaras
  1 sibling, 0 replies; 3+ messages in thread
From: parazyd @ 2016-05-03 17:08 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1467 bytes --]

On Tue, 03 May 2016, Daniel Quinn wrote:

>    Some time ago after an update ls started returning output that looked like
>    this:
> 
>  8hOk25T.jpg                                'Janeway Wallpaper-iPhone.png'
>  'Screenshot from 2016-04-06 16-15-15.png'  microsoft.png
>  'Away mission Wallpaper-iPhone.png'        'Screenshot from 2016-03-18 14-29-06.png'
>  'Screenshot from 2016-04-07 11-29-02.png'  gcal.png
> 
>    Note that some of the files have a single quote (‘) surrounding them, and
>    others don’t. I understand that this makes things easier to do stuff like
> 
>  for f in $(ls /path/to/whatever); do something; fi
> 
>    But since I do that a lot less than I just do this:
> 
>  ls -l
> 
>    I’d like to revert to the old way so my eye isn’t jumping left & right all
>    the time.
> 
>    I see that I can just write an alias:
> 
>  alias ls="ls --quoting-style=literal"
> 
>    But I’d hate to do that if the default is “literal” and there’s some
>    config installed somewhere that’s changing this. Does anyone have some
>    information regarding whether this is a new default upstream or if a
>    Gentoo package was somehow modified to do this?
> 
>    ​

Yes, the quoting is upstream behavior since the last few versions of
coreutils. Anyway, if you mind it, keep it as an alias, it doesn't get
in the way :)

-- 
~ parazyd
0333 7671 FDE7 5BB6 A85E  C91F B876 CB44 FA1B 0274


[-- Attachment #2: Type: application/pgp-signature, Size: 1513 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-user] Re: How to stop ls from quoting output
  2016-05-03 17:07 [gentoo-user] How to stop ls from quoting output Daniel Quinn
  2016-05-03 17:08 ` parazyd
@ 2016-05-04 14:39 ` Nikos Chantziaras
  1 sibling, 0 replies; 3+ messages in thread
From: Nikos Chantziaras @ 2016-05-04 14:39 UTC (permalink / raw
  To: gentoo-user

On 03/05/16 20:07, Daniel Quinn wrote:
> Some time ago after an update |ls| started returning output that looked
> like this:
>
> |8hOk25T.jpg 'Janeway Wallpaper-iPhone.png' 'Screenshot from 2016-04-06
> 16-15-15.png' microsoft.png 'Away mission Wallpaper-iPhone.png'
> 'Screenshot from 2016-03-18 14-29-06.png' 'Screenshot from 2016-04-07
> 11-29-02.png' gcal.png |
>
> Note that some of the files have a single quote (‘) surrounding them,
> and others don’t. [...]
>
> I see that I can just write an alias:
>
> |alias ls="ls --quoting-style=literal" |
>
> But I’d hate to do that if the default is “literal” and there’s some
> config installed somewhere that’s changing this. [...]

As mentioned already, it's an upstream default. However, on Gentoo, "ls" 
is already an alias for "ls --color=auto", because the upstream default 
is to now use colors. At least for bash anyway (the alias is set in 
/etc/bash/bashrc).

So I'd say just do:

   alias ls="ls --quoting-style=literal --color=auto"

in your ~/.bashrc and forget about it :-) Or, if you want it 
system-wide, just write that alias in a new file:

   /etc/bash/bashrc.d/aliases



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-04 14:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-03 17:07 [gentoo-user] How to stop ls from quoting output Daniel Quinn
2016-05-03 17:08 ` parazyd
2016-05-04 14:39 ` [gentoo-user] " Nikos Chantziaras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox