|
From: | Pierre Gaston |
Subject: | Re: [Help-bash] Duplicate one stdin as inputs to multiple programs without creating temp files |
Date: | Mon, 13 Feb 2012 08:00:26 +0200 |
Hi,
I have one input stream that needs to be fed to multiple programs
(they do not depends on each other, so that they can run in parallel).
As of now, I do something like the following, which needs a temp file.
But I don't like the idea of creating a temp file (as it may take
large disk space when the input is large). All prog1-3 can process the
input bit by bit, so if there is a way to somehow create three streams
that exactly the same as stdin, I think that the three programs can
run more efficiently (without being slowed by disk). I'm wondering if
there is a way to do so? Thanks!
~$ cat main2.sh
#!/usr/bin/env bash
> file
#These programs can run in parallel
prog1 < file &
prog2 < file &
prog3 < file &
--
Regards,
Peng
[Prev in Thread] | Current Thread | [Next in Thread] |