Mercurial > hg > dtl-dml-cliopatria
annotate cpack/dml/scripts/compression/rptlen @ 7:3c7cc53984a6 no-matlab tip
removed rcutils as seem incompatible with this version
(no history/2 defined)
author | wolffd.mail@googlemail.com |
---|---|
date | Wed, 25 Jul 2018 15:51:48 +0000 |
parents | 718306e29690 |
children |
rev | line source |
---|---|
Daniel@0 | 1 #!/usr/bin/env bash |
Daniel@0 | 2 # Insert rptlen into a pipeline to report the number of bytes passing through. |
Daniel@0 | 3 # NB. if the pipeline is terminated early by a later consuming process, the |
Daniel@0 | 4 # byte count will be wrong. |
Daniel@0 | 5 function buflen { |
Daniel@0 | 6 len=$(length) |
Daniel@0 | 7 echo "$1:" $len |
Daniel@0 | 8 } |
Daniel@0 | 9 function buflen2 { |
Daniel@0 | 10 length | sed -e "s/^/$1:/" |
Daniel@0 | 11 } |
Daniel@0 | 12 tee >(buflen2 "$1" 1>&2) |