1 2 3 4 5 6 7 8 9 10
# test read with a timeout of 0 -- input polling echo abcde | { sleep 0.25 ; read -t 0; } echo $? read -t 0 < $0 echo $? read -t 0 echo $?