![](/img/trans.png)
[英]Not able to add path in zsh profile, valid directory showing not found have tried in both bash and zsh
[英]Is it possible to have the same prompt and profile settings across both Bash and Zsh shells?
当我的代码不是DRY时,我开始发痒,由于种种原因,我在Bash和Zsh之间来回跳动。 除了在多个配置文件之间进行复制/粘贴外,还有一种方法可以指向一个中央文件,并在每个配置文件中提供该文件的source
,并将提示,别名,RVM配置和设置保存在一个文件中?
查看Ryan Bates的dotfile,似乎.bashrc是执行此操作的地方。 这是首选的解决方案吗? https://github.com/ryanb/dotfiles/commit/ac7e0c55ce038cbeadd8da2f521eb034d09eb131
我的点文件被编写为可在{ba,z}sh
运行,并且在两个shell中具有相同的行为。
zsh
的emulate bash
前source
荷兰国际集团bash
文件 要确定您所处的外壳,请使用:
if [ -n $BASH_VERSION ]; then
# Bash specific
else
# zsh specific
fi
另外,请参阅我常见的bash和zsh函数以获取有用的功能的抓包,这些功能在bash
和zsh
中均等效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.