Can you use tee to send output to a temp file?

process | tee file | whatevs

Data coming out of "process" will go to "file" but it will also go to 
"whatevs" for further processing.

Then you read from file.  Mutiple processes could make multiple files. 
Use the temp command to make the files.  One thing I'm not completely sure 
of:  does tee write continously to file, or does it do it in only at 
certain moments, like after each block of data comes out?  I'm guessing 
continuous but not sure.

Mike


On Thu, 25 Mar 2021, gregrwm wrote:

> question for bashers:
>
> a bash command entered as a foreground job may fork, leave something in the
> background, and exit to the bash prompt, and the job in the background will
> print it's output whenever it has any.  So far so good.
>
> i want to enter a command which launches 3 subcommands in parallel, wait up
> to 3 seconds unless all 3 subcommands finish sooner, sort all their
> output-so-far together, print it, and exit to the bash prompt at this
> point, and if any of the subcommands weren't finished, leave them in the
> background and let them print more output whenever they have any.
>
> easy?  hard?
>