Bug 431315 - /etc/profile.d/colorls.csh syntax error
/etc/profile.d/colorls.csh syntax error
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Ondrej Vasik
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-02 12:13 EST by Charles R. Anderson
Modified: 2008-02-04 18:40 EST (History)
2 users (show)

See Also:
Fixed In Version: coreutils-6.10-5.fc9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-02-04 18:40:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to fix colorls.csh (383 bytes, patch)
2008-02-02 12:13 EST, Charles R. Anderson
no flags Details | Diff
better fix for colorls.csh (676 bytes, patch)
2008-02-02 14:19 EST, Charles R. Anderson
no flags Details | Diff

  None (edit)
Description Charles R. Anderson 2008-02-02 12:13:57 EST
Description of problem:

There are some syntax/logic errors in the LS_COLORS handling in
/etc/profile.d/colorls.csh.

Version-Release number of selected component (if applicable):
coreutils-6.10-4.fc9.x86_64

How reproducible:
always

Steps to Reproduce:
1. open a new shell in tcsh
  
Actual results:

LS_COLORS: Undefined variable.
[cra@l profile.d]$ 

Expected results:
dircolors should be executed, no error messages should result.

Additional info:

Simple fix:

--- /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'
Comment 1 Charles R. Anderson 2008-02-02 12:13:57 EST
Created attachment 293799 [details]
patch to fix colorls.csh
Comment 2 Ondrej Vasik 2008-02-02 12:45:23 EST
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.
Comment 3 Charles R. Anderson 2008-02-02 14:19:23 EST
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.
Comment 4 Ondrej Vasik 2008-02-04 18:40:56 EST
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.

Note You need to log in before you can comment on or make changes to this bug.