我可以在Windows 10上获得(新的)bash来加载.profile

dhr*_*r_p 22 windows bash ubuntu windows-10 windows-subsystem-for-linux

我在Windows 10上安装了适用于Linux的新子系统(附带Windows周年更新),并开始使用它.

我注意到,即使.profile文件存在,启动shell(ubuntu bash)也不会加载.profile或.bash_profile.有修复吗?

(并且有很多声誉的人可以制作windows-bash标签吗?)

luk*_*3yx 26

默认情况下,此版本的Ubuntu-on-windows加载名为的文件.bashrc.

您可以放置​​脚本或添加以下行.bashrc(.bashrc如果不存在则创建):

. ~/.profile
Run Code Online (Sandbox Code Playgroud)

注意:如果.bashrc来自.profile,您可能想要将其注释掉以防止bash无休止地循环.

  • 如果不是很明显,你可能想删除/注释从你的.profile中获取源.bashrc的行,否则当.profile来源于.bashrc时你会在循环中结束 (3认同)