read_t.tests 357 B

12345678910
  1. # bash 3.2 outputs:
  2. # ><
  3. { echo -n 'te'; sleep 2; echo 'st'; } | (read -t 1 reply; echo ">$reply<")
  4. # ><
  5. { sleep 2; echo 'test'; } | (read -t 1 reply; echo ">$reply<")
  6. # >test<
  7. { echo -n 'te'; sleep 1; echo 'st'; } | (read -t 2 reply; echo ">$reply<")
  8. # >test<
  9. { sleep 1; echo 'test'; } | (read -t 2 reply; echo ">$reply<")