Live data from Hacker News

Zsh is your friend.

mikegrouchy.com

11–20 of 117 posts

Re: Zsh is your friend.

#11
post #7

While from what I have read about it zsh is a nice shell, it doesn't deal with what I find to be the biggest problem with bash, sh, and just about every shell that isn't fish: the horribly ugly and inconsistent syntax. And I think it's rather sad that on what is supposedly the most advanced shell of our generation, you still have to deal with a thousand ridiculous redirections and quoting styles, different delimiter…

The thing I like about fish is the easy history nav. I type "git" and press Up, and I get to go through my history of anything that started with "git" very quickly. I'll often remember I typed an svn command three weeks ago, but forget the parameters, and I'll have it back within 15 seconds. It's like magic!

This is indeed a lovely feature I couldn't live without.

In bash, you can get it by adding the following to your .inputrc (at least on mac terminal)

    "\e[B":    history-search-forward  
    "\e[A":    history-search-backward

Re: Zsh is your friend.

#12
post #7

While from what I have read about it zsh is a nice shell, it doesn't deal with what I find to be the biggest problem with bash, sh, and just about every shell that isn't fish: the horribly ugly and inconsistent syntax. And I think it's rather sad that on what is supposedly the most advanced shell of our generation, you still have to deal with a thousand ridiculous redirections and quoting styles, different delimiter…

The thing I like about fish is the easy history nav. I type "git" and press Up, and I get to go through my history of anything that started with "git" very quickly. I'll often remember I typed an svn command three weeks ago, but forget the parameters, and I'll have it back within 15 seconds. It's like magic!

[deleted]

Re: Zsh is your friend.

#13
I like zsh. Probably my favorite feature is that it will autocomplete paths/filenames in an scp command on the remote end if authentication is done with keys.

Also you can do stuff like /u/l/b and hit TAB.

Re: Zsh is your friend.

#14

While from what I have read about it zsh is a nice shell, it doesn't deal with what I find to be the biggest problem with bash, sh, and just about every shell that isn't fish: the horribly ugly and inconsistent syntax. And I think it's rather sad that on what is supposedly the most advanced shell of our generation, you still have to deal with a thousand ridiculous redirections and quoting styles, different delimiter…

I think your complaining more about shell scripting rather than the terminal use itself.

I think you're underestimating how frequently some folks do things like: for x in 'seq 1 100'; do echo "something with $x"; done

(Please forgive lack of backticks on my cellphone keyboard) Or many variations, like every line in a file, or result of a command piped to sed or awk and then processed. Init scripts are about the only shell scripts I write anymore, but I use frequently use it from the commandline, typically on remote terminals.

Re: Zsh is your friend.

#15
post #6

While from what I have read about it zsh is a nice shell, it doesn't deal with what I find to be the biggest problem with bash, sh, and just about every shell that isn't fish: the horribly ugly and inconsistent syntax. And I think it's rather sad that on what is supposedly the most advanced shell of our generation, you still have to deal with a thousand ridiculous redirections and quoting styles, different delimiter…

Once you learn the zen of shell script, like any programming language, those problems pretty much go away. Shell script is a tiny language packed with features and can be learned through constant use in a week, but like any language, it takes time to master. It's incredibly powerful for interactive use and data manipulation combined with the standard Unix tools and sometimes pulling out perl or python is more work th…

Maybe I lack the proper zen, but I haven't found this to be true at all.

Here's a good bash FAQ. It contains questions like "how do I use associative arrays", with answers like "this is a complex question."

I don't even have to ask in any half-decent scripting language.

http://mywiki.wooledge.org/BashFAQ/

Re: Zsh is your friend.

#16
post #10

Due to the poor spelling and grammar, gross oversimplification of zsh's advantages, and the inclusion of oh-my-zsh as a reason to switch, I found this post insulting (as a long time zsh user). And I actually want more people to use zsh, because that would mean more collaboration, more tips, and better script compatibility.

If my grammer is shitty, thats fine, never said my grammar/spelling/etc was amazing, just Zsh.

This post was intended as a nice introductory shoutout to Zsh. Oh-my-zsh is a great way for someone to get started with zsh if they wanted to try it out. It was never meant to be a complete guide to Zsh, and I wasn't going to list all the features, just a few that people who don't know anything about Zsh might be interested in.

But Hey, thanks for trying to give me a hard time. Stay classy.

Re: Zsh is your friend.

#17
post #7

Earlier quoted context omitted.

The thing I like about fish is the easy history nav. I type "git" and press Up, and I get to go through my history of anything that started with "git" very quickly. I'll often remember I typed an svn command three weeks ago, but forget the parameters, and I'll have it back within 15 seconds. It's like magic!

This is indeed a lovely feature I couldn't live without. In bash, you can get it by adding the following to your .inputrc (at least on mac terminal) "\e[B": history-search-forward "\e[A": history-search-backward

[deleted]

Re: Zsh is your friend.

#18
post #15
post #6

Earlier quoted context omitted.

Once you learn the zen of shell script, like any programming language, those problems pretty much go away. Shell script is a tiny language packed with features and can be learned through constant use in a week, but like any language, it takes time to master. It's incredibly powerful for interactive use and data manipulation combined with the standard Unix tools and sometimes pulling out perl or python is more work th…

Maybe I lack the proper zen, but I haven't found this to be true at all. Here's a good bash FAQ. It contains questions like "how do I use associative arrays", with answers like "this is a complex question." I don't even have to ask in any half-decent scripting language. http://mywiki.wooledge.org/BashFAQ/

I reccommend ksh over bash. That's all I use these days. It was sh done right, although it does have a bit of history to it for compatibility.

To use associative arrays in ksh:

  typeset -A table
  column="name"
  table[$column]="value"
  echo ${table[$column]}
ksh is much more decent than bash, although I reccommend using in an emacs M-x shell buffer for better command line editing.

Edit: forgot to dereference column when setting value in table.

Re: Zsh is your friend.

#19
- I'm using bash on Ubuntu. When I type "kill " I get a list of process numbers, not the list of files in my current directory as you imply.

- shared history sounds like a bug, not a feature. I have long lived terminals open, each dedicated to a specific purpose. Shared history would intermingle them.

- typing `gut` in bash gives me:

    No command 'gut' found, did you mean:
     Command 'cut' from package 'coreutils' (main)
     Command 'get' from package 'code-aster-run' (universe)
     Command 'gout' from package 'scotch' (universe)
     Command 'git' from package 'git' (main)
     Command 'gpt' from package 'gpt' (universe)
     Command 'gst' from package 'gnu-smalltalk' (universe)
You're batting 0/3. Certainly there must be some advantages to ZSH, but you haven't listed any yet.

(Note that I didn't have to configure any of this. Ubuntu probably did, but I didn't).

Re: Zsh is your friend.

#20
post #10

Due to the poor spelling and grammar, gross oversimplification of zsh's advantages, and the inclusion of oh-my-zsh as a reason to switch, I found this post insulting (as a long time zsh user). And I actually want more people to use zsh, because that would mean more collaboration, more tips, and better script compatibility.

Due to the major douchebaggery, gross misunderstanding of the purpose of this article, and inclusion of your "long time user" status, I can't take you comment seriously. Perhaps the purpose of this article is too complicated for your oversimplified brain. As a "long time" computer user I appreciate Mr. Grouchy taking the time to outline some of the finer things zsh has to offer.

If you REALLY wanted people to adopt zsh, and grow the community, you should probably try to list some other things that you enjoy.

But Hey, thanks for trying to integrate yourself. Stay Classy.

Post reply on HN