Well you could always do a little if check.
Code:
while [ true ]; do
read -t 1 -n 1 tmp_var
if [ ! -z $tmp_var ]; then
exit 0
fi
done
Not sure if this would work, since just pressing enter would make the $tmp_var contain "" which I think is the same as zero valued variable.
Problem with using read is that there is no way of checking if the variable is set in the first place. tmp_var="" is the same as not setting tmp_var, in contrast to other programming languages where setting "" inits the variable.
PHP or perl for example can check if the variable is set by using
PERL: if($var) { }
PHP: if(isset($var)) { }
Even thou both of these languages can declare content in a variable without first typecasting or defining the existance of a variable.
If anyone have a suggestion on how to check for a variables existance I would love to hear it

Anyway, back on topic.
script1.sh
Code:
#!/bin/bash
# Create a script to run ringbell.wav until script is killed. Also begin with returning the current PID
echo "
#!/bin/bash
pid=\$\$
echo $pid
while [ true ]; do
aplay ringbell.wav
sleep 1
done
" > /tmp/tmp.sh
# Execute and run the created script.
pid=$(bash /tmp/tmp.sh &)
# Wait for read.
read -n 1 -s tmp
# Kill the pid returned.
kill $pid
rm /tmp/tmp.sh
This could probably work as you want, but it's not fool proof... ctrl, alt and special keys that doesn't output a specific character won't be catched.
The best solution might be to either find a perl extension library which is built to handle keypresses or write a program in c or the like which can exit with a return value.
Anyway, going to stop ranting now and get back to work

Best regards
Fredrik Eriksson