Bug 68697

Summary: /etc/profile.d/colorls.csh uses TERM even if it isn't set
Product: [Retired] Red Hat Raw Hide Reporter: Jonathan Kamens <jik>
Component: fileutilsAssignee: Phil Knirsch <pknirsch>
Status: CLOSED RAWHIDE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-07-15 14:36:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 67217    

Description Jonathan Kamens 2002-07-12 16:15:36 UTC
In csh, you can't reference a variable that isn't set.

--- colorls.csh 2002/07/12 16:12:47     1.1
+++ colorls.csh 2002/07/12 16:14:06
@@ -1,10 +1,16 @@
 # color-ls initialization
 set COLORS=/etc/DIR_COLORS
-test -e "/etc/DIR_COLORS.$TERM" && set COLORS="/etc/DIR_COLORS.$TERM"
+if ($?TERM) then
+    test -e "/etc/DIR_COLORS.$TERM" && set COLORS="/etc/DIR_COLORS.$TERM"
+endif
 test -f ~/.dircolors && set COLORS=~/.dircolors
-test -f "~/.dircolors.$TERM" && set COLORS="~/.dircolors.$TERM"
+if ($?TERM) then
+    test -f "~/.dircolors.$TERM" && set COLORS="~/.dircolors.$TERM"
+endif
 test -f ~/.dir_colors && set COLORS=~/.dir_colors
-test -f "~/.dir_colors.$TERM" && set COLORS="~/.dir_colors.$TERM"
+if ($?TERM) then
+    test -f "~/.dir_colors.$TERM" && set COLORS="~/.dir_colors.$TERM"
+endif

 test -e "$COLORS" || exit 0

Comment 1 Phil Knirsch 2002-07-15 14:36:00 UTC
Fixing.

Read ya, Phil

Comment 2 Phil Knirsch 2002-07-15 14:47:18 UTC
OK, fixed colorls.csh included in fileutils-4.1.9-3, available at a rawhide
mirror near you real soon now. :-)

Thanks,

Read ya, Phil

Comment 3 Michael Fulbright 2002-12-20 17:38:25 UTC
Time tracking values updated