I have two processes, let's say Parent and Child. Parent launches the Child and communicates with it through child's stdin and stdout.Parent <-> ChildThese processes use text protocol and I need to investigate it. I would like to create a bash script which will be launched by the Parent instead of child. This script will launch the Child and in addition will dump stdin and stdout streams to a log files.Parent <-> MyProcess <-> Child            |            v          log.txtIs there a way in bash to do what I need or do I need to use C?
Dump process's stdin and stdout
linux;bash;shell;shell script;command line
The simplest approach would be to use tee to dump the input to and output from the child to two separate files like so:#!/bin/bashtee in.log | child | tee out.logYou could use tee's -a parameter (append) to write both logs to the same file, but I'm not quite sure if they'll be interleaved in the right order or just written one after the other:#!/bin/bashtee -a both.log | child | tee -a both.log