From: John Kelly on
On Fri, 13 Aug 2010 19:01:49 +0100, Eric <eric(a)deptj.eu> wrote:

>On 2010-08-13, pk <pk(a)pk.invalid> wrote:
>> John Kelly wrote:
>>
>>>>> ... because it reports the trap line, not what caused the trap.

>> Perhaps if you use single quotes it may work better.

>Actually, that's what I said, except the only responders to my post didn't
>read it properly - I have re-inserted the bit from the original post
>that makes it make sense! ("it" in the inserted bit is the single-quoted
>version which was abve that).
>
>Now it appears that some shell (pdksh?) plays around with its context
>before executing the trap command so that LINENO is set to zero - somebody
>trying to be too clever, I guess. As far as I can see, it is a _bug_ .

If I had tried it on bash first I probably would not have posted, since
it works on bash. But I was using the Interix ksh


> The version here contains the features of the ksh88 version,
> dated 11/16/88.

and I was puzzled by its behavior.

I fixed it up by putting a conditional in my script to set the ERR trap
only if running bash.



--
Web mail, POP3, and SMTP
http://www.beewyz.com/freeaccounts.php

First  |  Prev  | 
Pages: 1 2 3
Prev: download basics
Next: gnu-make prerequisites