News for hackers. Stuff that matters.
Re:Your Bash Prompt Needs This by saurik on Friday April 27, 2012 @01:46PM (#3900218)
Even if the answer is "none", zsh will need to additionally defend "what is the advantage of zsh for someone who already knows how to use bash", as any form of switch is going to come with a cost. I would therefore be really interested in your reasons (I use bash, as currently do all of the people I know and work with; [edit: apparently except one]).

It seems like most of the features listed as better than bash are either a) covered by bash 4.0, b) bad ideas (shared history among sessions), or c) only controversially better (searching around, people seem to argue back/forth about which programmable completion implementation is faster/better).

Re:Your Bash Prompt Needs This by aaronroyer on Friday April 27, 2012 @04:30PM (#3900901)
I agree that using zsh has to be justified. My suggestions for bash users who want to get more out of their (interactive) shell are:

1. Learn bash better. Lots of low-hanging fruit there to increase your productivity with minimal effort.

2. Learn how to customize your environment in bash. Know what every line in your dotfiles does. Add to your dotfiles gradually as you learn.

3. If you learn about some cool features in zsh, see if bash has the feature already. If it doesn't, see if you can mimic it easily with your own functions or scripts.

4. If you still want more features, make the switch to zsh and repeat steps 1 and 2 with zsh.

I think the worst is when people see a novel trick and switch to zsh and slam in oh-my-zsh* without knowing any shell basics. Now you have another shell and a big pile of code and you don't understand any of it. This usually won't cause problems, but you almost certainly won't be getting the most out of your shell. You'd be better off in most cases just digging into bash a little deeper.

I use zsh now, but I only switched after learning what bash could do and what its limitations are. I'll reevaluate zsh vs. bash 4.0 at some point, but for now I see zsh installed by default more often than bash 4.0 and it seems to me that most users interested in the best interactive shell experience are still on zsh and I like to learn from them.

* - I think oh-my-zsh is a great project - I'm not knocking it. I've borrowed lots of great stuff from it. But I think you should understand every line of code you are dumping into your environment, whether you are using oh-my-zsh or not.

Re:Your Bash Prompt Needs This by xyzzyb on Friday April 27, 2012 @03:01PM (#3900591)
zsh had me when I realized that

1) it's a drop in replacement for bash. All those scripts you have around have #!/bin/bash at the top, they will still work exactly as they always have.

2) You can selectively go back through your command history. You can arrow-up to go to previous commands just like in bash. But if you start a command (say, ssh) and then arrow-up you will then be cycling back through the last ways you entered that command. Super convenient.

Re:Your Bash Prompt Needs This by bretthoerner on Friday April 27, 2012 @03:23PM (#3900662)
> You can arrow-up to go to previous commands just like in bash. But if you start a command (say, ssh) and then arrow-up you will then be cycling back through the last ways you entered that command.

Or, if you'd like to do this in Bash, and any program that uses readline: In ~/.inputrc

    # Bind the up arrow to history search, instead of history step
    "\e[A": history-search-backward
    # And the reverse (down)
    "\e[B": history-search-forward
Re:Your Bash Prompt Needs This by eridius on Friday April 27, 2012 @03:39PM (#3900713)
I find it easier to just hit ^R when I want to search my history. And since that's a default keybinding, it works on any machine I touch.
Re:Your Bash Prompt Needs This by threedaymonk on Friday April 27, 2012 @04:06PM (#3900806)
I recently moved from tcsh to zsh, and this is one thing that seems to be a bit weird in zsh. For example, given

    git clone
    git rebase master
    git log
in my history, if I typed

    git r<UP>
I get 'git log', not 'git rebase master' as I'd expect.
Re:Your Bash Prompt Needs This by burgerbrain on Friday April 27, 2012 @06:23PM (#3901285)
Try:

  bindkey "^[[A" history-beginning-search-backward
Re:Your Bash Prompt Needs This by lawnchair_larry on Saturday April 28, 2012 @12:17AM (#3902017)
And that's why no one wants to bother switching.
Re:Your Bash Prompt Needs This by burgerbrain on Saturday April 28, 2012 @04:53PM (#3904080)
Actually, that's exactly why I switched. (more precisely, this could be said why: http://www.cs.elte.hu/zsh-manual/zsh_14.html)

If you don't want to use it, I don't see how that is any of my business. I was just trying to help out somebody who does, so there's hardly any reason to be an ass.

Re:Your Bash Prompt Needs This by lawnchair_larry on Saturday April 28, 2012 @06:46PM (#3904384)
To be honest, I tried it years back and liked it, but forgot about it and didn't miss it. I may try it again sometime.

All I'm saying is that most people won't like something that offers no immediate major benefit and has annoying defaults that they have to find an obscure setting to fix. This is probably why so few use emacs, even though it is awesome :)

Re:Your Bash Prompt Needs This by pavel_lishin on Monday April 30, 2012 @11:01AM (#3909528)
Everything has annoying defaults until you either change them or get used to them.
Re:Your Bash Prompt Needs This by julian37 on Friday April 27, 2012 @05:19PM (#3901065)
Excuse the nitpick, but what you meant to say is "All those scripts having #!/bin/bash at the top, they will still work exactly as they always have if you change the line to read #!/bin/zsh"... and it's not quite clear why you would want to do that if the script is already working as intended, hence this clarification.

Of course, a script that has #!/bin/bash at the top will keep working regardless of which shell you execute it on anyway, even a shell with a completely different syntax such as tcsh, because that shebang line will tell the OS to always use bash to execute the script--no matter what shell you're using to invoke the script.

It's different when you source a script (usually done using the eponymous shell built-in) since then the shebang line will be treated as a comment and ignored, and all other lines in the script will be executed in the context of the current shell.

Re:Your Bash Prompt Needs This by calloc on Friday April 27, 2012 @03:34PM (#3900701)
For number 2, this has been the default for tcsh for years now...
Re:Your Bash Prompt Needs This by blahedo on Saturday April 28, 2012 @02:30PM (#3903638)
Me too; I actually use up arrow for history-search-backward and also bindkey -v, so ESC-k gives me a non-search history (like the default up arrow behaviour).
Re:Your Bash Prompt Needs This by BCM43 on Friday April 27, 2012 @03:09PM (#3900618)
But if you start a command (say, ssh) and then arrow-up you will then be cycling back through the last ways you entered that command.

Like Ctrl+R?

Re:Your Bash Prompt Needs This by xyzzyb on Friday April 27, 2012 @03:15PM (#3900646)
Not exactly, but similar. If you want to see a demo, Ryan Bates highlights this feature (among others) with his ZSH screencast: http://railscasts.com/episodes/308-oh-my-zsh