我正在 Windows 10 Ubuntu Bash 中编辑 bashrc 脚本,但在编辑脚本时出错。现在 bash 在打开它时立即退出。有没有办法让我在不运行 bashrc 的情况下打开 Bash,或者我必须重新安装它?
您应该能够以.bashrc
与“常规”bash 中基本相同的方式跳过在 WSL 中加载默认文件:
--norc Do not read and execute the system wide initialization file
/etc/bash.bashrc and the personal initialization file ~/.bashrc
if the shell is interactive. This option is on by default if
the shell is invoked as sh.
因此,打开 WindowsCMD.exe
并键入
wsl.exe -e bash --norc
进入交互式 shell 后,您可以恢复对~/.bashrc
文件所做的更改。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句