bash 推荐 - Zsh 与 FishShell。脚本、生产力和高级用户本身
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1768350/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Recommendation - Zsh vs FishShell. Scripting, productivity and poweruser perse
提问by Vivek Sharma
I have spent sometime trying to pick one, on net comparisons are for zsh vs bash and fish vs bash. But, I could not find any comparison for zsh vs fish. I program in C and C++, apart from hello-world types, never done any major scripting. But now trying my hands at python and shell-scripts. Which shell keeps more juice in terms of productivity first and then development? Or in the end, the power and usability of any shell comes to its _rc files. So am I good enough with bash?
我花了一些时间试图选择一个,在网络上的比较是针对 zsh 与 bash 和 Fish 与 bash。但是,我找不到 zsh 与fish 的任何比较。我用 C 和 C++ 编程,除了 hello-world 类型,从来没有做过任何主要的脚本。但是现在尝试使用 python 和 shell 脚本。哪个壳先在生产力方面保留更多汁液,然后才是开发?或者最终,任何 shell 的功能和可用性都来自其 _rc 文件。那么我对 bash 够用了吗?
回答by SuperMagic
Historically there was a flame ware of sorts between the C shells (CSH and TCSH) and Bash. The complaint against the CSH variants are that they're bad for scripting.
从历史上看,在 C shell(CSH 和 TCSH)和 Bash 之间存在着各种各样的火焰。对 CSH 变体的抱怨是它们不利于脚本编写。
In the years I've been a CLI junkie, I've neverdone any standalone scripts where the scripting language was picked because that's what my shell was.
在我迷上了 CLI 的这些年里,我从来没有做过任何独立的脚本,因为我的 shell 就是这样选择脚本语言的。
I've written a variety of scripts that can broadly be divided into two categories:
我写过各种各样的脚本,大致可以分为两类:
- Those that help my command line productivity
- Those that are not directly related to my command line productivity.
- 那些帮助我提高命令行效率的东西
- 那些与我的命令行生产力没有直接关系的。
Scripts in category 1. are almost always written in my shell scripting language (often as functions as I'm using ZSH and was previously using BASH both of which support functions).
类别 1. 中的脚本几乎总是用我的 shell 脚本语言编写(通常作为函数,因为我使用的是 ZSH 并且以前使用 BASH 两者都支持函数)。
Scripts in category 2. are written in whatever seems like the most efficient (both development time and running time taken into consideration). I often find myself writing small scripts in Perl, C (compiled, obviously), BASH/ZSH/SH or what ever else I want. I've done a little Python scripting (but not much), and even resort to Java on occasion (compiled-ish, again).
类别 2. 中的脚本以看起来最有效的方式编写(考虑开发时间和运行时间)。我经常发现自己用 Perl、C(显然是编译的)、BASH/ZSH/SH 或我想要的任何其他语言编写小脚本。我已经编写了一些 Python 脚本(但不多),有时甚至会求助于 Java(再次编译为 ish)。
So what am I babbling about? Don't base you choice of shell on its standalone scripting capabilities. Choose your shell for it's utility to you as a shell. Script in whatever else you choose. You'll probably be good enough with BASH as your shell (though I like ZSH a bit more, **/* globbing is nice and a few other small things, but most scripts I've written for ZSH are early identical to their BASH counterparts).
那我胡说八道什么呢?不要根据 shell 的独立脚本功能来选择 shell。选择您的外壳,因为它作为外壳对您有用。在您选择的任何其他脚本中编写脚本。使用 BASH 作为 shell 可能已经足够好了(虽然我更喜欢 ZSH,**/* globbing 很好,还有一些其他小东西,但是我为 ZSH 编写的大多数脚本早期都与它们的 BASH 相同同行)。
回答by édouard Lopez
I had the same question and found :
我有同样的问题,发现:
- page that compare Unix Shells: Bash, Fish, Ksh, Tcsh, Zsh;
- Bash vs Zsh (vs Fish)a reddit thread ;
- What are the best Unix shells?
回答by ghostdog74
if you can't find any comparison between zsh vs fish, then try them out yourself. That's the only way you can tell which one you prefer, nobody else can tell you that. Also, define the meaning of productivity. For me, its the abundance of modules and the language's internal capabilities. If you have started with Python, go for it. As for shells, you can learn less of it (not saying totally forget about it), with regards to maybe understanding your rc scripts and other system stuffs etc. Beyond that, Python can do what the shell does.
如果您找不到 zsh 与fish 之间的任何比较,请自己尝试一下。这是你可以告诉你更喜欢哪一个的唯一方法,没有人可以告诉你。另外,定义生产力的含义。对我来说,它是丰富的模块和语言的内部功能。如果你已经开始使用 Python,那就去吧。至于 shell,你可以少学一些(不是说完全忘记它),关于可能理解你的 rc 脚本和其他系统的东西等等。除此之外,Python 可以做 shell 所做的事情。
回答by miku
You'll be most productive in an environment you already know. I used bash for years and its fine. It completes almost everything, can be used with git, mercurial...
在您熟悉的环境中,您的工作效率会最高。我使用 bash 多年,它很好。它完成了几乎所有事情,可以与 git、mercurial一起使用......

