On 2013. October 4. 14:51:00 Pierre Gaston wrote: > On Fri, Oct 4, 2013 at 2:20 PM, Kunszt Árpád ... > > > There is a race condition, you cannot know if echo will run before read.
I see, and it's logical. But this stills confuses me. arpad@terminus ~ $ for(( i=0; i<10; i++ )); do echo -n "" | { sleep 1s; read -t 0; echo $?; } ; done | sort | uniq -c 10 0 I expected that the read will return non-zero in this case. I think it returned with zero because the STDIN was still open. The docs said "read returns success if input is available on the specified file descriptor, failure otherwise". There wasn't any data on the file descriptor, it was just open. Am I still doing something wrong? Or I just misunderstanding the meaning of "input is available" term? I'm not a native English speaker (as you can se from my mails clearly). Thanks, Arpad Kunszt