Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've added abc.sh to /etc/profile.d When I start a new XTerm the environment variables in the abc.sh are not being set in the new XTerm. This works fine if I su - in an existing XTerm.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

I believe xterm does not run a login shell by default. Try using "xterm -ls" if you want to read your profile scripts

From the xterm man page

    -ls
    This option indicates that the shell that is started in the xterm 
    window will be a login shell (i.e., the first character of argv[0] 
    will be a dash, indicating to the shell that it should read the 
    user's .login or .profile).

From the bash man page

   When invoked as an interactive login shell, or a non-interactive
   shell with the  --login  option, it  first  attempts  to read and
   execute commands from /etc/profile and ~/.profile, in that order.
share|improve this answer
add comment

Check /etc/profile — it's the script that is supposed to load /etc/profile.d/*.sh. It's possible it only loads these in some situations, like non-login shells.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.