4 ms·
I'm not exactly sure what semantics you intend, it seems like you might be able to spell this { foo; baz; } | grep bar | sort -rn | tail or, in bash only:
by dllthomas 11y ago
I'm not exactly sure what semantics you intend, it seems like you might be able to spell this
{ foo; baz; } | grep bar | sort -rn | tail
or, in bash only:
cat <(foo | grep bar) <(baz | grep bar) | sort -rn | tail
This is assuming you didn't intend interleaving, for which the second syntax would work but you'd need something other than cat.
- qwertyuiop924 11y agothe <(...) syntax seems to be what I was looking for, passing a stream/pipeline to a function where a filename was expected. Hey, you learn something every day. EDIT: Unless you're just piping both of them to STDIN. piping two files to STDIN is useful, just not as useful as the thing that I wanted. This seems to be what you're doing.
- dllthomas 11y agoIt sets up a fifo, and passes in one end of it by name: $ echo <(:) <(:) /dev/fd/63 /dev/fd/62 So yeah, should be what you want for that use case :) As I mentioned though, it's a bashism.
- qwertyuiop924 11y agoNow I'm going to have to build a portable version of that. It shouldn't be too hard.