3
0

read_t0.tests 468 B

1234567891011121314
  1. # ><[0]
  2. echo Ok | { sleep 0.1; read -t 0 reply; echo ">$reply<[$?]"; }
  3. # This would not be deterministic: returns 0 "data exists" if EOF is seen
  4. # (true terminated) - because EOF is considered to be data (read will not block),
  5. # else returns 1 "no data".
  6. ## ><[????]
  7. #true | { read -t 0 reply; echo ">$reply<[$?]"; }
  8. # ><[0]
  9. true | { sleep 0.1; read -t 0 reply; echo ">$reply<[$?]"; }
  10. # ><[1]
  11. sleep 0.2 | { read -p IGNORED_PROMPT -t 0 reply; echo ">$reply<[$?]"; }