[英]Why the .bashrc file is not invoked after a sudo command?
I switch to another user using the command: 我使用以下命令切换到另一个用户:
sudo -u dsc -i
After the command executions moves to the home directory /home/dsc . 命令执行后,移至主目录/ home / dsc。
However, the .bashrc file in this directory is not executed. 但是,不会执行此目录中的.bashrc文件。 Why this happens?
为什么会这样?
sudo -i
starts a login shell; sudo -i
启动一个登录 shell; .bashrc
is only executed for non-login interactive shells. .bashrc
仅对非登录交互式shell执行。 One of .bash_profile
, .bash_login
, or .profile
should have been executed, though. 不过,
.bash_profile
, .bash_login
或.profile
应已执行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.