On 1/28/13 11:11 AM, Mart Frauenlob wrote:
On 28.01.2013 16:59, Chet Ramey wrote:
On 1/28/13 8:32 AM, Greg Wooledge wrote:
Well, any of the ways of testing the exit status should suffice.
Also note that you can't distinguish a failure-due-to-timeout from
other kinds of failures.
Not quite true. The manual says:
"The exit status is greater than 128 if the timeout is exceeded."
That does narrow the error space.
I observed an exit status of 142 if I remember correctly.
That's 128+SIGALRM (14).
Is that consistent over bash versions 3+ ?
I put it in explicitly in bash-4.0.
Could I rely on that for catching the evidence of timeout?
I don't plan on changing that, but SIGALRM does have different values on
different systems, so it all depends on just how portable you want your
shell code to be.