Live data from Hacker News

How zsh is more useful than bash

slideshare.net

91–100 of 151 posts

Re: How zsh is more useful than bash

#91
post #67

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 s…

You can easily drop your existing BASH aliases, etc, into .zshrc and not even notice that you've switched to zsh. As for "Oh My Zsh," I've never seen any reason to use it, as zsh works fine without any add-ons.

  | As for "Oh My Zsh," I've never seen any reason
  | to use it, as zsh works fine without any add-ons.
I'll second this. I've never found a need to use "Oh My Zsh," and I've been using zsh for a few years.

Re: How zsh is more useful than bash

#92

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 shou…

The command correction really bugs me in ZSH. 99% of the time it's wrong, and it doesn't learn even after the hundredth time of me telling it "no that's not what I meant, stick with the original". I keep thinking I should try writing a Bayesian filter for it or something, which would be a fun little project, but too low priority. Also annoying when I start a command with sh, hit tab to command complete it with a .sh…

Maybe I'm just not enough of a 'power user,' but I've been using Zsh since 2008 ~ 2009, and I rarely encounter the command-correction. The couple of times I've had it invoked were times where it correctly fixed a typo.

Re: How zsh is more useful than bash

#93
post #92

Earlier quoted context omitted.

The command correction really bugs me in ZSH. 99% of the time it's wrong, and it doesn't learn even after the hundredth time of me telling it "no that's not what I meant, stick with the original". I keep thinking I should try writing a Bayesian filter for it or something, which would be a fun little project, but too low priority. Also annoying when I start a command with sh, hit tab to command complete it with a .sh…

Maybe I'm just not enough of a 'power user,' but I've been using Zsh since 2008 ~ 2009, and I rarely encounter the command-correction. The couple of times I've had it invoked were times where it correctly fixed a typo.

It does fix typos for me too, but most of the time asks weird things like, I typed 'aptitude' did I mean '.aptitude'? It loves misinterpreting some of my commands as dotfiles. Huh?

Then again I have a knack for unintentionally breaking computers, so maybe I've done something in env or rc that's messed it up...

Re: How zsh is more useful than bash

#94
post #82
post #58

Earlier quoted context omitted.

i just tried fish. out of the box experience is great. not digging much yet but so far, so good. much faster start up time than zsh. this is 2013 already and i seriously dont' want a shell takes up a second or 2 to fire up.

I just tried fish and after half a minute declared it too slow: it is slow to complete (and not very good) and slow to print (or maybe slow to glob: "ls " takes far more time in fish than in bash or zsh). I do not know if it has all I love in zsh (things like (.) or (om^/) or * or !$), but I would not trade zsh's completion for gaining 10% on startup time.

Current fish author here. Thanks for giving fish a try! I hope you tested a 2.0 branch build, and not the 1.x train from 2009 - a lot has changed since then, including major performance improvements. Check $FISH_VERSION if you are unsure.

'ls' is slower on fish because it passes the -G ("colorize”) flag to /bin/ls, which gives you nice colors, but requires a stat of each file to determine its type. If you want faster but uncolored output, you could redefine the ls function to invoke the ls command with no arguments:

    alias ls 'command ls'
For other instances of slowness or bad completions, we’d sure appreciate it if you opened an issue on the github page at http://github.com/fish-shell/fish-shell/issues/

Re: How zsh is more useful than bash

#95
post #85
post #84

After using zsh for a while I moved back to bash. The main reason is that I want to learn bash well, because I might be writing shell scripts in the future and I don't want to use zsh specific features in my scripts so I don't want to get used to them.

> I don't want to use zsh specific features in my scripts How is this a worry? The topline in your bash script is '#!/bin/bash' Which tells the system 'run this with bash'.

Well I think there are if statements, loop conditions, and wildcard expansion that works in zsh but not in bash. So you could get used to something working in zsh, then you write an sh script with that thing, and then it doesn't work, and you have no idea why.

Example, I _think_ / (recursive globbing) works by default in zsh but not in bash. If you have / in a bash script without setting the right options then your script won't work and you will have no idea why until you've wasted a lot of time debugging.

Re: How zsh is more useful than bash

#96

Earlier quoted context omitted.

I use fish. It's pretty fun to use. It has some pain points (most notably missing things like subshells and inline variable exporting) but it's in beta, so we'll see where it goes. I love the completions though, and it's definitely worth checking out for those alone.

The subshell syntax is there, it just looks different. Instead of: echo `mycmd`. It's echo (mycmd).

I think you're getting your terminology mixed up: the bash man page calls what you described command substitution. Launching a subshell is something different and in bash it is done with parenthesis.

Re: How zsh is more useful than bash

#97
I find the way ZSH does completions for git kind of frustrating. It's a bit overzealous and so when you try to complete a remote branch lie:

"git co br"

It finishes with:

"git co origin/branch"

Whereas what I want is:

"git co branch"

because I have git set up to automatically create a local branch and set it up to push to the remote when I do that. Just a small annoyance. Overall I find ZSH has cool features that don't actually work that well, or at least they don't do all that much for me. Spell checking, for example, is rarely that useful since it tends to show up for commands that work fine. It really needs an option to say "never correct this" but it doesn't.

That said I still use it, don't see any reason not too. I mean, Powerline for ZSH looks gooood. Just not sure it's that much better than other shells.

Re: How zsh is more useful than bash

#99
The only thing that is keeping me from 100% zsh is that zsh is not everywhere and bash is. When you switch companies, sometimes admins/IT are not flexible in allowing zsh to be installed on build/vnc servers. Can anyone share some tips on how to manage dotfiles for zsh with backwards compatible bash so that you can truely have a portable config?

Re: How zsh is more useful than bash

#100
Only through zsh did I find out about tab auto-complete.

When I used bash, whenever I needed to uncompress a tarball I downloaded, I would type in the full, ~50 character filename. Only through zsh did I find out about tab autocomplete, and when I had to use bash on a friend's Mac, to my surprise, autocomplete worked.

I still use zsh, though.

Post reply on HN