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>enTue, 14 Jun 2011 11:37:20 -0400Comment by rfelsburg on dream's questionhttp://linuxexchange.org/questions/311/pipe-viewer-in-cmp#2591<p>Please accept an answer, or provide more details so we can help.</p>rfelsburgTue, 14 Jun 2011 11:37:20 -0400http://linuxexchange.org/questions/311/pipe-viewer-in-cmp#2591Answer 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