I know this question has been already asked & answered, but the solution I found listens for space and enter:
while [ "$key" != '' ]; do
read -n1 -s -r key
done
Is there a way (in bash) to make a script that will wait only for the space bar?