Answers to: pipe viewer in cmphttp://linuxexchange.org/questions/311/pipe-viewer-in-cmp<p>Hi linux folks, How do I apply pv (http://www.ivarch.com/programs/pv.shtml) in cmp? for example when cmp -l a.iso b.iso It looks like a complicated case in pv.</p> <hr>enWed, 12 May 2010 12:29:13 -0400Answer by Jazzhttp://linuxexchange.org/questions/311/pipe-viewer-in-cmp/522<p>Try the following:</p> <pre><code>pv myfirstiso.iso | cmp -l mysecondiso.iso &gt; output </code></pre> <p>The file "output" should contain the output of cmp afterwards, while the piping progress is correctly shown.</p> <p>Edit: pmarini was faster. ;)</p>JazzWed, 12 May 2010 12:29:13 -0400http://linuxexchange.org/questions/311/pipe-viewer-in-cmp/522Answer by pmarinihttp://linuxexchange.org/questions/311/pipe-viewer-in-cmp/520<p>It's not clear from your question what exactly is that you want to achieve.<p> <code>pv</code> is very similar to <code>cat</code> in its simpler form so you might have two different cases:<p> <code>cmp a.iso b.iso | pv</code> will process the output of the compare which might not give you an actual progress of the comparison task as the "result" could be empty (if the files are found to be the same) or much smaller than the actual original size of the compared files (given that you also don't know how big the result is going to be, it's impossible to compute the percentage...)<p> on the other hand <code>pv a.iso | cmp - b.iso</code> will use a little trick in order to read <code>a.iso</code> from the standard input and give you the progress of the file being fed to <code>cmp</code><p> Haven't tried this myself but it should be the right way...</p>pmariniWed, 12 May 2010 12:11:35 -0400http://linuxexchange.org/questions/311/pipe-viewer-in-cmp/520