I&#x27;m not exactly sure what semantics you intend, it seems like you might be able to spell this<p><pre><code>    { foo; baz; } | grep bar | sort -rn | tail
</code></pre>
or, in bash only:<p><pre><code>    cat &lt;(foo | grep bar) &lt;(baz | grep bar) | sort -rn | tail
</code></pre>
This is assuming you didn&#x27;t intend interleaving, for which the second syntax would work but you&#x27;d need something other than cat.