Yes, but I have always found that cumbersome and I was never sure which program has which pipe, and what will exactly happen if one of the reading/writing programs dies. (I am still not sure.)
Future readers, #bash on freenode says of this link:
< greybot> The infamous "Advanced" Bash Scripting Guide should be avoided unless you know how to filter out the junk. It will teach you to write bugs, not scripts. In that light, the BashGuide was written: http://mywiki.wooledge.org/BashGuide
They felt strongly enough to learn their bot of it. Keep this in mind, I haven't read much of either resource yet.
Related: anybody has ideas to achieve the following?
display the stdout of a program on the console and also write a gzipped version of stdout to a file.
I currently jump through some hoops (involving two term windows) to achieve. 'tee -a' to a named pipe in one window and in another window, 'gzip <' from that named pipe. Would prefer a single-window, single-command solution.
Very useful, hopefully I remember this when I need it next time (that being the bane of all bash cleverness). The >(foo) would benefit from some extra explanation though, currently it is not very clear how it differs from regular |foo.
>(foo) turns into a file name, so it can be passed to things that absolutely want a file name to write to. And multiple occurrences of this should work as you'd expect.
[+] [-] pstadler|12 years ago|reply
[+] [-] runn1ng|12 years ago|reply
So I am glad that what OP wrote exists.
[+] [-] saljam|12 years ago|reply
If if a command, for example, needs to do 2 passes, it'll will either have to be 'smart' enough to stick the output in a buffer or fail.
[+] [-] eatitraw|12 years ago|reply
vimdiff =(ls /bin) =(ls /usr/bin)
You can use it even from bash:
zsh -c 'vimdiff =(ls /bin) =(ls /usr/bin)'
[+] [-] dllthomas|12 years ago|reply
[+] [-] recuter|12 years ago|reply
< greybot> The infamous "Advanced" Bash Scripting Guide should be avoided unless you know how to filter out the junk. It will teach you to write bugs, not scripts. In that light, the BashGuide was written: http://mywiki.wooledge.org/BashGuide
They felt strongly enough to learn their bot of it. Keep this in mind, I haven't read much of either resource yet.
[+] [-] perlgeek|12 years ago|reply
[+] [-] gnaritas|12 years ago|reply
[+] [-] vsbuffalo|12 years ago|reply
[+] [-] nkurz|12 years ago|reply
[+] [-] taway2012|12 years ago|reply
Related: anybody has ideas to achieve the following?
display the stdout of a program on the console and also write a gzipped version of stdout to a file.
I currently jump through some hoops (involving two term windows) to achieve. 'tee -a' to a named pipe in one window and in another window, 'gzip <' from that named pipe. Would prefer a single-window, single-command solution.
[+] [-] ColinWright|12 years ago|reply
[+] [-] runejuhl|12 years ago|reply
[+] [-] _paulc|12 years ago|reply
[+] [-] inevitable|12 years ago|reply
[deleted]
[+] [-] zokier|12 years ago|reply
[+] [-] bartbes|12 years ago|reply
[+] [-] kps|12 years ago|reply
[+] [-] panzi|12 years ago|reply