Red Hat Bugzilla – Bug 431315
/etc/profile.d/colorls.csh syntax error
Last modified: 2008-02-04 18:40:56 EST
Description of problem:
There are some syntax/logic errors in the LS_COLORS handling in
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. open a new shell in tcsh
LS_COLORS: Undefined variable.
dircolors should be executed, no error messages should result.
--- /etc/profile.d/colorls.csh.orig 2008-02-02 12:05:36.000000000 -0500
+++ /etc/profile.d/colorls.csh 2008-02-02 12:11:46.000000000 -0500
@@ -1,6 +1,6 @@
#! /bin/csh -f
# color-ls initialization
-if ( "$LS_COLORS" != '' ) then
+if ( $?LS_COLORS ) then
#do not override user specified LS_COLORS and use them
alias ll 'ls -l --color=tty'
alias l. 'ls -d .* --color=tty'
Created attachment 293799 [details]
patch to fix colorls.csh
Thanks for report... I did only quick check for csh script and missed that
problem...sorry for that, thanks for report, will fix that in next rawhide
coreutils build after weekend.
Created attachment 293802 [details]
better fix for colorls.csh
The first patch doesn't work if LS_COLORS= is in the environment already (e.g.
LS_COLORS is there, but blank). This patch will set LS_COLORS correctly in
that case, mimicking the behavior of /etc/profile.d/colorls.sh. The nested
"if" was the only way I could get it to work right in tcsh.
Problem is hopefully fixed in coreutils-6.10-5.fc9 - so closing RAWHIDE - anyway
I used completely different style, so please feel free to add any comments about
syntax of that layout (with added 256 colors support). TIA.