Recently studied Rhce, Umask here, the book said to modify/etc/profile and/ETC/BASHRC two files, but did not explain the two differences. So after viewing the Internet, I understand how each is used. /etc/profile is the corresponding login,/ETC/BASHRC is the corresponding open shell. But the actual use of the difference between, if BASHRC is the corresponding shell, then change this file is not OK? Finally, the practice of their own, the discovery is still different, hereby share, also make a record.
Experiment Preparation: Change the umask in the/etc/profile file to 007 and change the umask in/ETC/BASHRC to 077.
Experimental steps:
1. Log in as root and open the Shell,umask value 022
2.su test, Umask value 077
3.su-test,umask value 007
Experimental results: If you just switch users and do not log back in, then the profile script will not execute, thus the script in the BASHRC function.
So, if you do not want to make ambiguity for their management of the trouble, or honestly change two documents it. Since there is no time to write the program, but if you are not mistaken, the program should use the value in the BASHRC.
The difference between Redhat Linux/etc/profile and/ETC/BASHRC