On Monday, January 28, 2013 06:27:24 PM Mart Frauenlob wrote:
> On 28.01.2013 17:48, Chet Ramey wrote:
> > On 1/28/13 11:43 AM, Mart Frauenlob wrote:
> >
> >> So if i do like
> >>
> >> (($? > 128)) && printf "timeout reached, or signal received\n"
> >>
> >> will that be correct and generic enough, if I write a bash-only script?
> >
> > Yes, that would work.
>
>
> Thank you very much for your kind assistance.
>
> Best regards
>
> Mart
>
Also, for Bash's read:
/* `read -t 0 var' tests whether input is available with select/FIONREAD,
and fails if those are unavailable */
if (have_timeout && tmsec == 0 && tmusec == 0)
#if 0
return (EXECUTION_FAILURE);
#else
return (input_avail (fd) ? EXECUTION_SUCCESS : EXECUTION_FAILURE);
#endif
...
Don't know whether that's worth testing or improves reliability in your case.
--
Dan Douglas