I have two programs. First one is client and the second one is server. they exchange data in text format using stdin and stdout.
I would like to put proxy bash script between them and record everything coming from stdin to a file.
I tried the following code, but /tmp/f-copy.txt is empty
Proxy.sh:
exec 6<&0
exec 6>/tmp/f-copy.txt
server
What do I do wrong?
Look at the tee command, it's what you want. From the man page:
The tee utility copies standard input to standard output, making a copy in zero or more files. The output is unbuffered.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With