#!/bin/bash while [ true ] do aplay -Dhw:0,3 -c 2 test.wav & aplay -Dhw:0,7 -c 2 test.wav & sleep 1 pkill -SIGTERM aplay ll=1 while [ $ll ] do num=`ps -e|grep aplay|wc -l` echo $num if [ $num -ne 0 ];then echo "err close" pkill -SIGTERM aplay echo $? sleep 1 else break fi done done