Bug 68697 - /etc/profile.d/colorls.csh uses TERM even if it isn't set
/etc/profile.d/colorls.csh uses TERM even if it isn't set
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: fileutils (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Knirsch
Mike McLean
:
Depends On:
Blocks: 67217
  Show dependency treegraph
 
Reported: 2002-07-12 12:15 EDT by Jonathan Kamens
Modified: 2015-03-04 20:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-07-15 10:36:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jonathan Kamens 2002-07-12 12:15:36 EDT
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 10:36:00 EDT
Fixing.

Read ya, Phil
Comment 2 Phil Knirsch 2002-07-15 10:47:18 EDT
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 12:38:25 EST
Time tracking values updated

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