Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
bash_completion我脚本中的脚本.bash_profile运行缓慢,导致新终端启动速度很慢。是否可以提供一个 shell 来运行命令,然后在后台获取 bash_completion 脚本?
bash_completion
.bash_profile
我不这么认为,bash_completion 取决于设置的一些变量,如果您尝试在后台加载它们(使用&),它们将在子shell 上创建,并且在您正在运行的shell 上不可用。
&
但是,您可以将它们从 .bashrc 移动到 .bash_profile 然后注销,这样它们每个会话只加载一次,但我不确定这是否可行,因为其中大多数是数组,而 afaik 那些无法导出.
我想您也可以尝试某种丑陋但可能会加快速度的“缓存”。