<p>As I build *nix piped commands I find that I want to see the output of one stage to verify correctness before building the next stage but I don't want to re-run each stage. Does anyone know of a program that will help with that? It would keep the output of the last stage automatically to use for any new stages. I usually do this by sending the result of each command to a temporary file (i.e. tee or run each command one at a time) but it would be nice for a program to handle this.</p>

<p>I envision something like a tabbed interface where each tab is labeled with each pipe command and selecting a tab shows the output (at least a hundred lines) of applying that command to to the previous result.</p>

[{'answer_id': 63783, 'author': 'pjz', 'author_id': 8002, 'author_profile': 'https://Stackoverflow.com/users/8002', 'pm_score': 3, 'selected': False, 'text': "<p>Use 'tee' to copy the intermediate results out to some file as well as pass them on to the next stage of the pipe, like so:</p>\n\n<pre><code>cat /var/log/syslog | tee /tmp/syslog.out | grep something | tee /tmp/grep.out | sed 's/foo/bar/g' | tee /tmp/sed.out | cat &gt;&gt;/var/log/syslog.cleaned\n</code></pre>\n"}, {'answer_id': 63803, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': "<p><code>tee</code>(1) is your friend. It sends its input to both the specified file and stdout.  </p>\n\n<p>Stick it between your pipes. For example:</p>\n\n<pre><code>ls | tee /tmp/out1 | sort | tee /tmp/out2 | sed 's/foo/bar/g'\n</code></pre>\n"}, {'answer_id': 63838, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>You can also use pipes if you need bidirectional communication (i.e. with netcat): </p>\n\n<pre><code>mknod backpipe p\nnc -l -p 80 0&lt;backpipe | tee -a inflow | nc localhost 81 | tee -a outflow 1&gt;backpipe\n</code></pre>\n\n<p>(<a href="http://clug.net.nz/index.php/netcat" rel="nofollow noreferrer" title="via">via</a>)</p>\n'}, {'answer_id': 63877, 'author': 'GodEater', 'author_id': 6756, 'author_profile': 'https://Stackoverflow.com/users/6756', 'pm_score': 1, 'selected': False, 'text': '<p>There\'s also the "pv" command - available in debian / ubuntu repostitories which shows you the throughput of your pipes.</p>\n\n<p>An example from the man page :\nTransferring a file from another process and passing the expected size to pv:</p>\n\n<pre><code>          cat file | pv -s 12345 | nc -w 1 somewhere.com 3000\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/63771', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6770/']