[bproc]bpsh and pipes

Erik Arjan Hendriks hendriks@hendriks.cx
Thu, 26 Apr 2001 23:39:34 -0400


On Tue, Apr 24, 2001 at 05:14:17PM -0500, Dan Smith wrote:
> I have two questions.  What does bpsh -n really do?  And how do you pipe
> output from one program to another program while using bpsh? For instance,
> 
> bpsh 1 foo | bar
> 
> where "foo" is a program that produces large amounts of data and writes them
> to stdout and "bar" is a program that processes that data and receives it
> from stdin.  Using the above example as is seems to pump everything to the
> master node and then back again creating lots of network traffic.  What is
> the correct way to do this?  Thanks.

The "-n" replaces stdin with /dev/null.  That's useful when you don't
want bpsh sucking up input from soemthing else when it shouldn't.  In
scripts, for example.

As far as things sloshing back to the master node, yeah, that's what
should happen with the above usage.  The easiest way to setup the pipe
on the remote node is with "sh".  You can do something like:

bpsh 1 sh -c "foo | bar"

You'll have to make sure that both binaries are available on the
remote machine, though.

- Erik
-- 
Erik Arjan Hendriks          Printed On 100 Percent Recycled Electrons
erik@hendriks.cx                   Contents may settle during shipment