我想为自己\xe2\x80\x94和许多其他用户\xe2\x80\x94创建一个脚本,该脚本将配置使用特定版本工具集\xe2\x80\xa6的环境,然后使用该脚本打开一个交互式shell环境。
\n\n似乎发生的情况是~/.bashrc执行了各种用户初始化脚本 ( ) 并破坏了部分设置。
许多用户(包括我自己)在其 \xe2\x80\xa6 中配置了默认版本的工具~/.bashrc,并希望保持这种状态。
我为其制作此脚本的备用版本仅在一小部分时间内使用。
\n\n我已经尝试过以下方法:
\n\nsetup the environment\nbash\n # runs ~/.bashrc and breaks the setup\n\nbash -i\n # runs ~/.bashrc and breaks the setup\n\nbash --rcfile <(echo echo in subshell... $PATH)\n the displayed $PATH is correct - but I immediately return\n to the parent (no longer a subshell - not interactive)\n\nbash --rcfile -i <echo echo in subshell... $PATH)\n the displayed $PATH is correct - but I immediately return\n …Run Code Online (Sandbox Code Playgroud) bash ×1