Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
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

    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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .