#!/bin/bash # ./gstreamer-record.sh & left=$! ./gstreamer-record-r.sh & right=$! cleanup() { kill -s SIGINT $left kill -s SIGINT $right exit 0 } trap cleanup SIGINT while true; do sleep 1 done