view bin/cdb_chain.sh @ 341:6d0e29e22b12 trim

merge
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Wed, 04 Mar 2026 21:14:15 +0000
parents 2bed05d3e158
children 1ff1bbf30472
line wrap: on
line source

#!/usr/bin/bash
# Chain together n steps of test_cdbp 
# Usage cdb_chain n
# First step takes stdin, intermediate steps use FIFOs, last step goes to stdout
export PYTHONPATH=~/lib/python/cc/lmh
n=$1
mkdir -p /tmp/hst
me=/tmp/hst/$$
mkfifo ${me}_from0
cat | { cdbp.sh 0 > ${me}_from0 ; } &
seq 1 $((n - 2)) | while read i ; do
 mkfifo ${me}_from$i
 { cdbp.sh $i < ${me}_from$((i - 1)) > ${me}_from$i ;  rm ${me}_from$((i - 1)) ; } &
done
cdbp.sh $((n - 1)) < ${me}_from$((n - 2))
rm ${me}_from$((n - 2))