在Cygwin中的bash加载速度缓慢 [英] Slow load time of bash in cygwin

查看:480
本文介绍了在Cygwin中的bash加载速度缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前时刻的bash大约需要2秒的负载。我已经跑了 -x 庆典标志和我看到的输出,它好像是PATH在Cygwin中加载了很多次。有趣的是我用在Linux环境下相同的文件,但它工作正常,没有重载问题。可能由以下原因引起的问题?

 如果[`UNAME -o` =Cygwin的];然后
    ....
科幻


解决方案

正如你在你的答案已经指出,这个问题是Cygwin的的bash-completion软件包。快速和简单的解决方法是禁用的bash补全,而要做到正确的方法是运行Cygwin的SETUP.EXE(再次如果需要),并选择要卸载该程序包。

较长的解决方案是通过 /etc/bash_completion.d 文件工作,禁用不需要的人。在我的系统,用于减缓击的加载时间(邮递员,阴影的dsniff和的e2fsprogs)所有的最大元凶究竟做了什么,因为没有安装它们的创建完成的工具。

如果您重命名 /etc/bash_completion.d 文件有一个 .bak的延伸,它的LL停止加载该脚本。已经禁用所有,但我以这种方式系统中的一个选择37脚本,我剪的平均时间bash_completion了95%(6.5秒0.3秒)来加载。

At the moment bash takes about 2 seconds to load. I have ran bash with -x flag and I am seeing the output and it seems as though PATH is being loaded many times in cygwin. The funny thing is I use the same file in linux environment, but it works fine, without the reload problem. Could the following cause the problem?

if [ `uname -o` = "Cygwin" ]; then
    ....
fi

As you've noted in your answer, the problem is Cygwin's bash-completion package. The quick and easy fix is to disable bash-completion, and the correct way to do that is to run Cygwin's setup.exe (download it again if you need to) and select to uninstall that package.

The longer solution is to work through the files in /etc/bash_completion.d and disable the ones you don't need. On my system, the biggest culprits for slowing down Bash's load time (mailman, shadow, dsniff and e2fsprogs) all did exactly nothing, since the tools they were created to complete weren't installed.

If you rename a file in /etc/bash_completion.d to have a .bak extension, it'll stop that script being loaded. Having disabled all but a select 37 scripts on one of my systems in that manner, I've cut the average time for bash_completion to load by 95% (6.5 seconds to 0.3 seconds).

这篇关于在Cygwin中的bash加载速度缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆