在/etc/profile前后分别加上一行:
into /etc/profile
leave /etc/profile
/etc/bashrc、/home/oracle/.bash_profile、/home/oracle/.bashrc也类似处理,则切换用户时可以看到如下效果从而可以得知,利用四个文件的先后顺序:
[root@law etc]# su - oracle
into /etc/profile
leave /etc/profile
into bash_profile
into /home/oracle/bashrc ========在.bash_profile中调用了/home/oracle/bashrc
into /etc/bashrc ==========在/home/oracle/bashrc 中调用了/etc/bashrc
leave /etc/bashrc
leave /home/oracle/bashrc
leave bash_profile
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/37724/viewspace-152563/ ,如需转载,请注明出处,否则将追究法律责任。