Live data from Hacker News

How zsh is more useful than bash

slideshare.net

1–10 of 151 posts

Re: How zsh is more useful than bash

#2
I like process substitution feature in zsh. In bash you can write:

vimdiff And this will create two pipes, where output of each ls will go. Unfortunately, vimdiff sometimes needs to do second pass on the files, so this command won't work properly when outputs are large.

But in zsh you can write

vimdiff =(ls /bin) =(ls /usr/bin)

and this will create temporary normal files, instead of just pipes, and vimdiff will work fine.

Re: How zsh is more useful than bash

#6
post #4

Problem is zsh is not omnipresent like bash is. I'm sure that if you use zsh you also use Plan 9, code in D, write LuaTeX in Emacs and wear a monocle.

Some of these things exist in bash too. For example, newer versions of bash support the recursive glob.

    shopt -s globstar
    rm **/*.swp

Re: How zsh is more useful than bash

#7
The killer feature to me is scp completion, e.g.

  scp someuser@someserver:
… will ssh into the server, fetch the file list and offer it for completion locally (granted you have set up public key authentication)

Re: How zsh is more useful than bash

#8
post #7

The killer feature to me is scp completion, e.g. scp someuser@someserver: … will ssh into the server, fetch the file list and offer it for completion locally (granted you have set up public key authentication)

my bash does this...

Re: How zsh is more useful than bash

#10
post #2

I like process substitution feature in zsh. In bash you can write: vimdiff And this will create two pipes, where output of each ls will go. Unfortunately, vimdiff sometimes needs to do second pass on the files, so this command won't work properly when outputs are large. But in zsh you can write vimdiff =(ls /bin) =(ls /usr/bin) and this will create temporary normal files, instead of just pipes, and vimdiff will work…

Holy cannoli, that's an awesome trick. I've always created temporary files manually then diffed, then deleted them.
Post reply on HN