Mercurial > hg > dml-open-cliopatria
diff cpack/dml/scripts/compression/rptlen @ 0:718306e29690 tip
commiting public release
author | Daniel Wolff |
---|---|
date | Tue, 09 Feb 2016 21:05:06 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpack/dml/scripts/compression/rptlen Tue Feb 09 21:05:06 2016 +0100 @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# Insert rptlen into a pipeline to report the number of bytes passing through. +# NB. if the pipeline is terminated early by a later consuming process, the +# byte count will be wrong. +function buflen { + len=$(length) + echo "$1:" $len +} +function buflen2 { + length | sed -e "s/^/$1:/" +} +tee >(buflen2 "$1" 1>&2)