bug-coreutils
[Top][All Lists]
Advanced

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

Re: Not sure how to best reply re: dir_colors situation


From: Joshua Rodman
Subject: Re: Not sure how to best reply re: dir_colors situation
Date: Fri, 5 Jun 2009 21:13:04 -0700
User-agent: Mutt/1.5.18 (2008-05-17)

On Fri, Jun 05, 2009 at 08:49:17PM -0700, Joshua Rodman wrote:
> I unexepectedly discovered some of my .ogg files were showing up with
> the wrong color.  I thought my filesystem was broken, or some attributes
> had been set on the files, or that they were executable, or something.
> 
> Eventually I realized that they were multiply hardlinked.
> 
> This is not something I ever want colorized with ls.  And I certainly do
> not want it to ever "win" over any other color settings which are
> meaningful to me.  I created my color settings in the year 1995 and they
> have worked since until now.
> 
> I checked the dir_colors manpage, which made no mention of hard links.
> I checked the ls manpage which made no mention of hardlinks.
> 
> I checked the coreutils project page, which did not discuss the issue.
> 
> Eventually I found mention of the issue in the NEWS for the source
> release.  It showed a recipe for special manipulation of hte variable
> post-invocation.

Buh buh buh -- the recommended sed does not work.

address@hidden:~/rc/bash >dircolors --version
dircolors (GNU coreutils) 7.3
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by H. Peter Anvin.

address@hidden:~/rc/bash >ls --version
ls (GNU coreutils) 7.3
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Richard M. Stallman and David MacKenzie.

address@hidden:~/rc/bash >dircolors ~/rc/dir_colors
LS_COLORS='no=00:fi=00:di=01;35:ln=01;36:or=01;31:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:ex=01;32:*.dat=00;31:*.ovl=00;31:*.sys=00;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.dll=00;33:*.c=01;33:*.cpp=01;33:*.pas=01;33:*.bas=01;33:*.h=01;33:*.jpg=00;34:*.jpeg=00;34:*.png=00;34:*.gif=00;34:*.bmp=00;34:*.xbm=00;34:*.xpm=00;34:*.tif=00;34:*.pcx=00;34:*.cfg=01;34:*.conf=01;34:*config=01;34:*.mod=00;35:*.mtm=00;35:*.s3m=00;35:*.xm=00;35:*.ptm=00;35:*.med=00;35:*.emd=00;35:*.it=00;35:*.nst=00;35:*.stm=00;35:*.dmf=00;35:*.dsm=00;35:*.mdl=00;35:*.669=00;35:*.far=00;35:*.ult=00;35:*.amf=00;35:*.ams=00;35:*.mp3=00;35:*.ogg=00;35:*.wav=00;35:*.flac=00;35:*.tar=00;36:*.tgz=00;36:*.arj=00;36:*.a0*=00;36:*.taz=00;36:*.lzh=00;36:*.lha=00;36:*.rar=00;36:*.zoo=00;36:*.arc=00;36:*.zip=00;36:*.z=00;36:*.Z=00;36:*.gz=00;36:*.bz2=00;36:*.7z=00;36:*.ace=00;36:*.txt=01;37:*.doc=01;37:*.nfo=01;37:*.faq=01;37:*.wri=01;37:*.pdf=01;37:';
export LS_COLORS

address@hidden:~/rc/bash >dircolors ~/rc/dir_colors |grep hl # no hl present
address@hidden:~/rc/bash >dircolors ~/rc/dir_colors |sed
s/hl=[^:]*:/hl=:/
LS_COLORS='no=00:fi=00:di=01;35:ln=01;36:or=01;31:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:ex=01;32:*.dat=00;31:*.ovl=00;31:*.sys=00;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.dll=00;33:*.c=01;33:*.cpp=01;33:*.pas=01;33:*.bas=01;33:*.h=01;33:*.jpg=00;34:*.jpeg=00;34:*.png=00;34:*.gif=00;34:*.bmp=00;34:*.xbm=00;34:*.xpm=00;34:*.tif=00;34:*.pcx=00;34:*.cfg=01;34:*.conf=01;34:*config=01;34:*.mod=00;35:*.mtm=00;35:*.s3m=00;35:*.xm=00;35:*.ptm=00;35:*.med=00;35:*.emd=00;35:*.it=00;35:*.nst=00;35:*.stm=00;35:*.dmf=00;35:*.dsm=00;35:*.mdl=00;35:*.669=00;35:*.far=00;35:*.ult=00;35:*.amf=00;35:*.ams=00;35:*.mp3=00;35:*.ogg=00;35:*.wav=00;35:*.flac=00;35:*.tar=00;36:*.tgz=00;36:*.arj=00;36:*.a0*=00;36:*.taz=00;36:*.lzh=00;36:*.lha=00;36:*.rar=00;36:*.zoo=00;36:*.arc=00;36:*.zip=00;36:*.z=00;36:*.Z=00;36:*.gz=00;36:*.bz2=00;36:*.7z=00;36:*.ace=00;36:*.txt=01;37:*.doc=01;37:*.nfo=01;37:*.faq=01;37:*.wri=01;37:*.pdf=01;37:';
export LS_COLORS
address@hidden:~/rc/bash >dircolors ~/rc/dir_colors |sed s/hl=[^:]*:/hl=:/ 
|grep hl 

But the colors come anyway:

address@hidden:~/rc/bash >ls -l functions
-rw-r--r-- 1 jrodman jrodman 2744 2006-12-03 07:10 functions
address@hidden:~/rc/bash >ls --color=yes functions |xxd # plain color
0000000: 1b5b 306d 1b5b 3030 6d66 756e 6374 696f  .[0m.[00mfunctio
0000010: 6e73 1b5b 306d 0a1b 5b6d                 ns.[0m..[m
address@hidden:~/rc/bash >ln functions functions-link
address@hidden:~/rc/bash >ls --color=yes functions |xxd # blue
0000000: 1b5b 306d 1b5b 3434 3b33 376d 6675 6e63  .[0m.[44;37mfunc
0000010: 7469 6f6e 731b 5b30 6d0a 1b5b 6d         tions.[0m..[m

I'm unclear whether dir_colors will sometimes spit out an hl value.
Having a colorization occur that isn't even in LS_COLORS is unfortunate.

-josh




reply via email to

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