#!/bin/bash
for cmd in "$@"; do {
echo "Process \"$cmd\" started";
$cmd & pid=$!
PID_LIST+=" $pid";
} done
trap "kill $PID_LIST" SIGINT
echo "Parallel processes have started";
wait $PID_LIST
echo
echo "All processes have completed";
runtwo.shMake it executable
chmod +x runtwo.shand use like
./runtwo.sh "xboxdrv --trigger-as-button --id 0 --led 2 --detach-kernel-driver --deadzone 4000 --silent & sleep 1" "xboxdrv --trigger-as-button --id 1 --led 3 --detach-kernel-driver --deadzone 4000 --silent & sleep 1"
It looks like you're new here. If you want to get involved, click one of these buttons!