Mercurial > hg > cc > cirrus_work
annotate bin/cdb_chain.sh @ 392:faad1c51c289 plus
part 4 == body for RESP working
| author | Henry S. Thompson <ht@inf.ed.ac.uk> |
|---|---|
| date | Mon, 22 Jun 2026 16:00:02 +0100 |
| parents | 1ff1bbf30472 |
| children |
| rev | line source |
|---|---|
| 281 | 1 #!/usr/bin/bash |
| 2 # Chain together n steps of test_cdbp | |
|
366
1ff1bbf30472
got the full chain running
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
306
diff
changeset
|
3 # Usage cdb_chain.sh n |
| 281 | 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 |
|
366
1ff1bbf30472
got the full chain running
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
306
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 |
|
366
1ff1bbf30472
got the full chain running
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
306
diff
changeset
|
13 { cdbp.sh $i < ${me}_from$((i - 1)) > ${me}_from$i ; rm ${me}_from$((i - 1)) |
|
1ff1bbf30472
got the full chain running
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
306
diff
changeset
|
14 #echo f$((i - 1)) ended 1>&2 |
|
1ff1bbf30472
got the full chain running
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
306
diff
changeset
|
15 } & |
| 281 | 16 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
|
17 cdbp.sh $((n - 1)) < ${me}_from$((n - 2)) |
|
366
1ff1bbf30472
got the full chain running
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
306
diff
changeset
|
18 #echo f$((n - 2)) ended 1>&2 |
|
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
|
19 rm ${me}_from$((n - 2)) |
