When mbuffer
finishes on the receiving side it prints the time and speed, which I would like to get into $time
and $speed
.
Trying to implement this answer
#!/bin/bash
exec 3>&1 4>&2 #set up extra file descriptors
error=$( { mbuffer -v 0 -4 -s 128k -m 1G -I 8023 3>&1 4>&2 > /tank3/fs5/tst; } )
exec 3>&- 4>&- # release the extra file descriptors
echo "The message is \"${error}\""
Executing this and in another terminal
echo secret | mbuffer -4 -s 128k -m 1G -O localhost:8023
I get
# ./fff
summary: 0.0 KiByte in 0.1 sec - average of 0.0 KiB/s
The message is ""
secret
where I was hoping to see the summary message between the ""
.
Question
I assume that the summary message must be printed to STDERR, as I pipe STDOUT to a file, and its content is correct.
Can anyone see what I am doing wrong?