[RndTbl] Help with pv?

Adam Thompson athompso at athompso.net
Sat Dec 13 00:42:56 CST 2014


Something Trevor said made me think of this:

Host 2:
(nc -l 10001 | pv -c -N one >/dev/null & nc -l 10002 | pv -c -N two 
 >/dev/null & nc -l 10003 | pv -c -N three >/dev/null & nc -l 10004 | pv 
-c -N four >/dev/null)

Host 1:
( pv -c -N one </dev/zero | nc host2 10001 & pv -c -N two </dev/zero | 
nc host2 10002 & pv -c -N three </dev/zero | nc host2 10003 & pv -c -N 
four </dev/zero | nc host2 10004 )

As long as all the pv instances have the same controlling tty and 
process group, which is accomplished by putting the whole thing inside 
parentheses ( "(",")" ) the IPC stuff works correctly. It's designed for 
parts of a single pipeline yes, but this trick appears to fool pv 
adequately well.  At least on Linux and OpenBSD this works, not sure 
about Solaris.

-Adam

-- 
-Adam Thompson
  athompso at athompso.net
  Cell: +1 204 291-7950
  Fax: +1 204 489-6515



More information about the Roundtable mailing list