1

Possible Duplicate:
How do I set a user environment variable? (permanently, not session)

I have a user XX and I want to set the env variables for it. I looked for .bash_profile in the home dir but there was none. SO, I tried with .bashrc, but when I try to see the env variables (printenv), my variables are not there. This is killing me. I tried for root, and it works. But it does not work for user XX.

cindy
  • 461

2 Answers2

0

export MYVARIABLE="variable-value"

This only works if user XX's default shell is bash since you added the variables in .bashrc.

-1

It should work. You may need to have the user log back in or source the .bashrc file to reload it (. ~/.bashrc), but you shouldn't set your env. variables in .bashrc.

You can also create a new .bash_profile file containing XX's exports and modify his .bashrc to make sure it gets loaded with:

if [ -f ~/.bash_profile ]; then . ~/.bash_profile; fi

sebnukem
  • 166