#! /usr/bin/env bash for i in `seq 1 3` ; do xterm -e "python $1 player-${i}.ini $2 $3 $4 ; read" & pids[ $i ]=$! done echo ${pids} wait ${pids}