do not deadlock
This commit is contained in:
14
play zone/waitForKey1
Executable file
14
play zone/waitForKey1
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
echo "1"
|
||||
echo "Press 'q' to exit"
|
||||
count=0
|
||||
while : ; do
|
||||
read -n 1 k <&1
|
||||
if [[ $k = q ]] ; then
|
||||
printf "\nQuitting from the program\n"
|
||||
break
|
||||
else
|
||||
((count=$count+1))
|
||||
echo "Press 'q' to exit"
|
||||
fi
|
||||
done
|
Reference in New Issue
Block a user