3 ms·
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
by eatitraw 13y ago
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.
- kemist 13y agoHoly cannoli, that's an awesome trick. I've always created temporary files manually then diffed, then deleted them.
- deleted 13y ago[deleted]
- McUsr 13y agoThat seems like a good reason for switching to zsh!
- eatitraw 13y agoActually 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.