Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><s>I don't think that you can count on it. The <code>wc</code> here runs in a separate process, so there is no synchronization.</s> My trial run suggests that it might be (at least in bash). As <a href="https://stackoverflow.com/questions/3143452/is-the-order-that-tee-prints-to-stdout-guaranteed/3143539#3143539">Daenyth explains</a>, this particular case is special, but try it with <code>grep -o line</code> instead of <code>wc</code> and see what you get. </p> <p>That said, on my MacBoox I get:</p> <pre><code>$ printf "line1\nline2\nline3\nline4\nline5\n" | tee &gt;(grep -o line ) | (awk '{print "this is awk: "$0}') this is awk: line1 this is awk: line2 this is awk: line3 this is awk: line4 this is awk: line5 this is awk: line this is awk: line this is awk: line this is awk: line this is awk: line </code></pre> <p>very consistently. I'd have to read the bash man page very closely to be sure.</p> <p>Similarly:</p> <pre><code>$ printf "line1\nline2\nline3\nline4\nline5\n" | tee &gt;(awk '{print "*" $0 "*"}' ) | (awk '{print "this is awk: "$0}') this is awk: line1 this is awk: line2 this is awk: line3 this is awk: line4 this is awk: line5 this is awk: *line1* this is awk: *line2* this is awk: *line3* this is awk: *line4* this is awk: *line5* </code></pre> <p>everytime...and</p> <pre><code>$ printf "line1\nline2\nline3\nline4\nline5\n" | tee &gt;(awk '{print "*" $0 "*"}' ) | (grep line) line1 line2 line3 line4 line5 *line1* *line2* *line3* *line4* *line5* </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload