I did a quick search of the list archives, but I couldn't find anything about this, which is a little surprising, making me suspect my search, not the obscurity of the problem. The problem I am having has to do with the file /etc/profile.d/colorls.sh, and its import by and but a regular user. By that I mean, when I log is as my normal user, color ls is enabled, and I have all the regular aliases, such as "ll" and "l.". When I perform a "su" to root, however, the aliases go away, as does the color ls. Running "bash -x /etc/profile.d/colorls.sh" as root produces the following:

+ alias 'rm=rm -i'
+ alias 'cp=cp -i'
+ alias 'mv=mv -i'
+ '[' -f /etc/bashrc ']'
+ . /etc/bashrc
+++ id -gn
+++ id -un
+++ id -u
++ '[' root = root -a 0 -gt 99 ']'
++ umask 022
++ '[' '' ']'
+ COLORS=/etc/DIR_COLORS
+ '[' -e /etc/DIR_COLORS.ansi ']'
+ '[' -e /root/.dircolors ']'
+ '[' -e /root/.dircolors.ansi ']'
+ '[' -e /root/.dir_colors ']'
+ '[' -e /root/.dir_colors.ansi ']'
+ '[' -e /etc/DIR_COLORS ']'
++ dircolors --sh /etc/DIR_COLORS
+ eval 'LS_COLORS='\'''\'';' export LS_COLORS
++ LS_COLORS=
++ export LS_COLORS
+ '[' -z '' ']'
+ return
/etc/profile.d/colorls.sh: line 12: return: can only `return' from a function or sourced script
+ egrep -qi '^COLOR.*none' /etc/DIR_COLORS
+ alias 'll=ls -l --color=tty'
+ alias 'l.=ls -d .* --color=tty'
+ alias 'ls=ls --color=tty'

This is all well and good except that none of the aliases at the bottom are actually created. This is a regular RH 8.0 install, nothing fancy. What's the deal?

ahp

Attachment: PGP.sig
Description: PGP signature

Reply via email to