Bash is more "popular" because it is the sane default in most cases, and few users would even think of going through the trouble to replace it (or even know replacing it is an option). Zsh is popular in a counter-culture way for those users who do go out of the way to make a choice of which shell they want. I don't really miss zsh when I can't use it, but it does have a lot of nice extras that bash doesn't.
I was a long time zsh user. As Dave said the globbing is pretty cool and it was the single feature that kept me from switching to another shell. But now I use bash, because there are more/better completion scripts available for the bash. The mercurial script is awesome (e.g. it offers only changed files for the commit command).
Some people love how easy zsh makes it to rename large numbers of files, because of the colon-suffix operator that can be applied to filenames:
for f in *.HTM; mv $f $f:s/HTM/html
See? The "s" expression after the colon is just like the sed(1) or perl(1) operator for making a substitution in a string. And there are special operators, I believe, that make working with extensions especially easy (this example is poor code, since it would break if "HTM" is an earlier part of the name of the file).
But the reason that I myself love zsh is because of all of the redirection magic. I love being able to do something like:
diff -a <(set) <(ssh guinness set)
to compare how my environments differ on two different hosts.
Finally, I love programming completions to be specific to how I use commands; but bash might have that ability, too, for all I know.
The above posts have all mentioned nice things about zsh. One thing about the shell is that it's not much good unless you have a good .zshrc script to activate all the nice features. I have my own that I like, I should really put it up on the web someday. You can find others' .zshrc files if you look arount.
I happily used bash for years with lots of customizations (completion, prompt, ...), learned all the tricks and was quite satisfied with it. A couple of days ago I read about ZSH and got curious. Last week I did the switch and I'm _very_ impressed. Completion is so much cooler than bash-completion, and it has countless other great features.
11 comments:
I didn't know zsh *was* that popular. I think BASH rules the roost for the most part.
I use zsh all the time. The killer feature for me is the extensive globbing, including recursing through a directory tree. e.g.
ls src/**/*.(py|xml)
to list all the python and xml files in the src directory tree. It has been a long time since I have needed to use find...|xargs...
It has lots of other features that bash is lacking - far too many to list here.
Bash is more "popular" because it is the sane default in most cases, and few users would even think of going through the trouble to replace it (or even know replacing it is an option). Zsh is popular in a counter-culture way for those users who do go out of the way to make a choice of which shell they want. I don't really miss zsh when I can't use it, but it does have a lot of nice extras that bash doesn't.
I was a long time zsh user. As Dave said the globbing is pretty cool and it was the single feature that kept me from switching to another shell.
But now I use bash, because there are more/better completion scripts available for the bash. The mercurial script is awesome (e.g. it offers only changed files for the commit command).
Some people love how easy zsh makes it to rename large numbers of files, because of the colon-suffix operator that can be applied to filenames:
for f in *.HTM; mv $f $f:s/HTM/html
See? The "s" expression after the colon is just like the sed(1) or perl(1) operator for making a substitution in a string. And there are special operators, I believe, that make working with extensions especially easy (this example is poor code, since it would break if "HTM" is an earlier part of the name of the file).
But the reason that I myself love zsh is because of all of the redirection magic. I love being able to do something like:
diff -a <(set) <(ssh guinness set)
to compare how my environments differ on two different hosts.
Finally, I love programming completions to be specific to how I use commands; but bash might have that ability, too, for all I know.
At the rate you are getting patches for this, maybe should put the source up on bitbucket.org or github.com...
Great idea, Sprout. When I pick a service for the PyMOTW stuff, I'll put virtualenvwrapper there, too.
The above posts have all mentioned nice things about zsh. One thing about the shell is that it's not much good unless you have a good .zshrc script to activate all the nice features. I have my own that I like, I should really put it up on the web someday. You can find others' .zshrc files if you look arount.
bash is bloated, zsh is strange ;)...
Try "mksh", it's the public domain Korn shell with ongoing support:
http://www.mirbsd.org/mksh.htm
virtualenv(wrapper) totally rocks, thanks for all the goodness!
I happily used bash for years with lots of customizations (completion, prompt, ...), learned all the tricks and was quite satisfied with it. A couple of days ago I read about ZSH and got curious. Last week I did the switch and I'm _very_ impressed. Completion is so much cooler than bash-completion, and it has countless other great features.
Grab this great set of configurations:
http://github.com/mattfoster/zshkit
and try yourself. I won't go back to bash!
(same goes for git and svn)
Thanks for the zsh tips, joshua, I'll check those out!
Post a Comment