Re: [Help-bash] Bash Trap: How to Get Line Number of a Subprocess with Non-Zero Status

2017-01-02 Thread Chet Ramey
On 1/2/17 4:59 AM, Steve Amerige wrote: > From an end-user's perspective, it is unexpected that the LINENO has the > value of the > beginning of the function instead of the line at which the ERR was caught > by trap. Sure, it's missing functionality. Eduardo's patch was pretty much spot-on. It w

Re: [Help-bash] Bash Trap: How to Get Line Number of a Subprocess with Non-Zero Status

2017-01-02 Thread Steve Amerige
On 12/30/2016 12:50 PM, Chet Ramey wrote: It's the difference between a simple command, which has a line number, and a subshell command, which does not. The subshell command's line number is derived from the execution context, which is relative to the start of

Re: [Help-bash] Bash Trap: How to Get Line Number of a Subprocess with Non-Zero Status

2016-12-30 Thread Chet Ramey
On 12/29/16 10:39 PM, Eduardo Bustamante wrote: > I'm adding the bug-bash list, since I think this is actually a bug in > the parse_comsub function, or maybe in execute_command_internal. I > haven't been able to figure it out yet. What I do know is that these > two should behave the same: > >

Re: [Help-bash] Bash Trap: How to Get Line Number of a Subprocess with Non-Zero Status

2016-12-30 Thread Eduardo Bustamante
On Thu, Dec 29, 2016 at 9:39 PM, Eduardo Bustamante wrote: > I'm adding the bug-bash list, since I think this is actually a bug in > the parse_comsub function, or maybe in execute_command_internal. I > haven't been able to figure it out yet. What I do know is that these > two should behave the sam

Re: [Help-bash] Bash Trap: How to Get Line Number of a Subprocess with Non-Zero Status

2016-12-29 Thread Eduardo Bustamante
On Thu, Dec 29, 2016 at 11:20 AM, Steve Amerige wrote: > I've posted a question to StackOverflow, but I'm hoping the experts here can > chime in. > > http://stackoverflow.com/questions/41346907/bash-trap-how-to-get-line-number-of-a-subprocess-with-non-zero-status > > In essence, I want to know how