Mercurial > hg > dml-open-cliopatria
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:718306e29690 |
---|---|
1 #!/usr/bin/env bash | |
2 # Insert rptlen into a pipeline to report the number of bytes passing through. | |
3 # NB. if the pipeline is terminated early by a later consuming process, the | |
4 # byte count will be wrong. | |
5 function buflen { | |
6 len=$(length) | |
7 echo "$1:" $len | |
8 } | |
9 function buflen2 { | |
10 length | sed -e "s/^/$1:/" | |
11 } | |
12 tee >(buflen2 "$1" 1>&2) |