Mercurial > hg > cc > cirrus_work
annotate bin/cdb_chain.sh @ 354:90f541382b0e plus
use gzip_plus to get access to gzip block offsets
| author | Henry S. Thompson <ht@inf.ed.ac.uk> |
|---|---|
| date | Mon, 16 Mar 2026 10:43:45 +0000 |
| parents | 2bed05d3e158 |
| children | 1ff1bbf30472 |
| rev | line source |
|---|---|
| 281 | 1 #!/usr/bin/bash |
| 2 # Chain together n steps of test_cdbp | |
| 3 # Usage cdb_chain n | |
| 4 # First step takes stdin, intermediate steps use FIFOs, last step goes to stdout | |
| 5 export PYTHONPATH=~/lib/python/cc/lmh | |
| 6 n=$1 | |
|
306
2bed05d3e158
get rm in loop in right place, ensure unique pipe names
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
305
diff
changeset
|
7 mkdir -p /tmp/hst |
|
2bed05d3e158
get rm in loop in right place, ensure unique pipe names
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
305
diff
changeset
|
8 me=/tmp/hst/$$ |
|
2bed05d3e158
get rm in loop in right place, ensure unique pipe names
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
305
diff
changeset
|
9 mkfifo ${me}_from0 |
|
2bed05d3e158
get rm in loop in right place, ensure unique pipe names
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
305
diff
changeset
|
10 cat | { cdbp.sh 0 > ${me}_from0 ; } & |
| 281 | 11 seq 1 $((n - 2)) | while read i ; do |
|
306
2bed05d3e158
get rm in loop in right place, ensure unique pipe names
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
305
diff
changeset
|
12 mkfifo ${me}_from$i |
|
2bed05d3e158
get rm in loop in right place, ensure unique pipe names
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
305
diff
changeset
|
13 { cdbp.sh $i < ${me}_from$((i - 1)) > ${me}_from$i ; rm ${me}_from$((i - 1)) ; } & |
| 281 | 14 done |
|
306
2bed05d3e158
get rm in loop in right place, ensure unique pipe names
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
305
diff
changeset
|
15 cdbp.sh $((n - 1)) < ${me}_from$((n - 2)) |
|
2bed05d3e158
get rm in loop in right place, ensure unique pipe names
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
305
diff
changeset
|
16 rm ${me}_from$((n - 2)) |
