umask setting changes after cd
linux, redhat, umask
Solution
Thanks to Barry Brown for the comment above - I was tearing my hair out with this problem (on OSX, not Linux) and it is indeed rvm that was the culprit in my case. Check your .profile, .bash_profile etc for a line like this:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Comment it out, relaunch your shell and that should solve the problem. I had no idea rvm was so rude and intrusive. Better to load it only when needed rather than for every shell.
Problem
I've got something odd to report. On my newly configured RHEL5 server my shell is set to /bin/bash I have umask set to 002 in .bashrc. When I first log in, umask appears to work correctly: ``` $ touch a $ ls -l a -rw-rw-r-- etc..... ``` if I create another file it works: ``` $ touch b $ ls -l b -rw-rw-r-- etc..... ``` but... if I change directory (to any directory), then umask gets set back 022: ``` $ cd /var/www/whatever $ touch c $ ls -l c -rw-r--r-- etc..... ``` completely bizarre. Anybody seen anything like this? Can they think of anything to check? why would the umask setting change after cd'ing? Thanks, -Charlie