Live data from Hacker News

How zsh is more useful than bash

slideshare.net

41–50 of 151 posts

Re: How zsh is more useful than bash

#41

Earlier quoted context omitted.

> It's better. What's "better" about it?

1) A pretty great experience even before you start customizing. I only add a git status section to my status line and set some environment variables in my config.fish file. 2) An effort to clean up and orthogonalize shell syntax. The potential portability means I usually still make bash scripts when I'm sharing for others, but for my own stuff it's great. 3) Suggested completions. I start typing a command and if it's…

Regarding #3, you can also just press right arrow.

Re: How zsh is more useful than bash

#42
post #25

Earlier quoted context omitted.

These days, I use Zsh on OpenBSD. I don't use Plan 9, code in D or write LuaTeX, but I do use Emacs and wear a monocle. The last two are not a coincidence as the first (arguably more adequate substitute for God), invariably leads to the latter, most excellent eye wear. And a note to my Mac friends : "Using csh is like trying to type with your feets[sic] (if you're used to zsh or ksh)." http://forums.bsdnexus.com/view…

Bash has been the default shell since OS X 10.3 in 2003.

And since then I keep going back to zsh. :)

Re: How zsh is more useful than bash

#43

I love using zsh (in combination with oh-my-zsh) on OSX but the only thing I've noticed after using it a year is that it's becoming very very slow. As in, it usually takes me 5-10 seconds to login to a new session (locally) and be able to see the prompt and type something. Tab auto completion takes a second or two (even for files). Combined with the git plugin I have enabled (which does "git status" on every prompt i…

> I love using zsh (in combination with oh-my-zsh) on OSX but the only thing I've noticed after using it a year is that it's becoming very very slow. As in, it usually takes me 5-10 seconds to login to a new session (locally) and be able to see the prompt and type something.

Clean the history file.

Re: How zsh is more useful than bash

#44
That's actually the first time I've seen a decent set of reasons why zsh is worth using. Well done.

Almost every other "Switch from bash to zsh, it has this awesome killer feature" article I've seen has raved about a feature that's available in Bash & has been for years.

I'm starting at a new job in a month or so, I shall try & use it as an opportunity to switch to zsh since I won't have any can't-live-without bash shortcuts in place at that point.

(Last time I tried switch to zsh, it took OMZ to get it useable, but it also made it too slow to live with. Hopefully starting with a clean slate will do the trick)

Re: How zsh is more useful than bash

#45

Bah! Give me Ksh.

I much prefer ksh myself, in particular for scripting. Fun fact about how bash is broken:

  export a=0
  cat $file | while read line
  do
    a=$(expr $a + 1)
  done
Bash will fork the while loop as a separate process, inheriting (copying) its own environment, and the variable will only update locally, not in the parent process.

Re: How zsh is more useful than bash

#46

I think the zsh-vs-bash debate is centered on minimalist vs. full-featured. For instance, the git completion example is very ugly in zsh to me. I know what git commands do, and I'd much prefer for the completion to take 1-2 lines total than one line per possible command, as in the zsh example. The prompt examples are similar -- my PS1 is local green="$(tput setaf 2)" local reset="$(tput sgr0)" export PS1="\[$green\]>…

Bash isn't really "minimalist" compared to the likes of dash or mksh. [rob-pike]Completion is a compromise, the Unix Way is to make your commands short and simple enough that you can memorize them all![/rob-pike]

Re: How zsh is more useful than bash

#47
While zsh may be more 'useful', I find it a bit too smart. Many of the features are very interactive, and introduce a non-determinism that messes up my ability to fix errors. An example is command correction. I (usually) know when a command is wrong, and go to fix it without thinking. Being asked if you really meant some other command interferes with this, and while seemingly helpful, makes you wonder if a shell should really be doing that.

The directory listing shares the same problem. Once you have a list, it's just as easy to type the path then it's to cycle through the list (not that zsh stops this), it's just another interactive feature.

Then there is path-completion, which removes the / on the end of tab-completed paths. Since rsync treats a directory with / different to that without one, this feature annoys me to no end when using zsh.

I understand that all these are options, and could easily be configured. I just wonder how other people feel about them. Does anyone actively use these features? Do you find they can occasionally get in the way?

Re: How zsh is more useful than bash

#48
I've been using zsh for a while now, mostly without using any special feature that isn't available (maybe with some tweaks) in bash. The additional value for me is that I get all of this out of the box, or with not much effort. That's to oh-my-zsh I've got a nice looking theme (agnoster). Thanks to "zsh-syntax-highlighting" I get syntax highlighting, thanks to "history-substring-search" i got a nice way to search in my command history. All of those just took less than one minute to set up on my machine.

Luckily enough, I don't have to work over servers which may or may not have zsh, so i don't need to worry about that. Whenever I have to use a PC with bash (or any other *sh), I can easily get the same result, with a slightly-worse user experience.

Also, as a nice tip, zsh will complete "kill" and "killall". So that I don't have to fire up htop every time I want to kill a process.

Re: How zsh is more useful than bash

#50

I see your zsh and I raise you fish: http://ridiculousfish.com/shell/ Try it. It's better.

I tried fish for a while, and it's really great. The out of the box experience is way better than zsh and bash. But I switched to zsh, mostly because I couldn't get used to the different syntax.
Post reply on HN