bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newlines in ERR trap affect caller 0 line number


From: Chet Ramey
Subject: Re: Newlines in ERR trap affect caller 0 line number
Date: Thu, 4 Nov 2021 11:52:52 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.2.1

On 10/31/21 6:06 PM, Quinn Grier wrote:

> Bash Version: 5.1
> Patch Level: 8
> Release Status: release
> 
> Description:
>     When an ERR trap includes newlines, the line number returned by
>     "caller 0" is affected.

Thanks for the report. I'll take a look. Right now, the ERR trap (really
all traps) is treated as if the text of the trap appears inline in the
source right after the command that triggered it, so parsing the text of
the trap command increments the line number starting at the line number
of the triggering command.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]