Hacker News new | past | comments | ask | show | jobs | submit login

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

vimdiff <(ls /bin) <(ls /usr/bin) [ It is an example. In real world, I use this feature for comparing outputs of one version of program with another one ]

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.




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


That seems like a good reason for switching to zsh!


Actually I use bash for my daily work, so I run zsh from bash:

zsh -c 'vimdiff =(ls /bin) =(ls /usr/bin)'

A couple of similarly useful features, and I'm swtiching to zsh. But now I am too lazy to make proper configuration.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: