#! /bin/bash set -e set -o pipefail cleanup() { kill -9 $(jobs -p) || true } trap cleanup EXIT python3 ./state_to_buttons.py & python3 testdata/rand_0_13_stream.py \ | ( while read -r line; do #echo $line >&2 echo $line done ) \ | python3 ./stream_to_state.py