for session in $(screen -ls | grep -o '[0-9]*\.foo'); do 
    screen -S "${session}" -X quit; 
done