Re: Newlines in ERR trap affect caller 0 line number

2021-11-04 Thread Chet Ramey
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

Re: Newlines in ERR trap affect caller 0 line number

2021-11-04 Thread Alex fxmbsw7 Ratchev
thats around the same as aliases, inline text replacements , yes ? informative question On Thu, Nov 4, 2021, 16:53 Chet Ramey wrote: > 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 incl

Re: Newlines in ERR trap affect caller 0 line number

2021-11-04 Thread Chet Ramey
On 11/4/21 11:55 AM, Alex fxmbsw7 Ratchev wrote: > thats around the same as aliases, inline text replacements , yes ? > informative question No. It's a different processing stage. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocr

BASH_COMMAND does not expand correctly in subshells inside traps.

2021-11-04 Thread Emanuele Torre
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/bin' -DSTANDARD_UTILS_PATH='/usr/bin' -DSYS_BASHRC='/etc/bash

Re: BASH_COMMAND does not expand correctly in subshells inside traps.

2021-11-04 Thread Emanuele Torre
> And noticed that $BASH_COMMAND always expanded to: > > read -p "[...:...] $BASH_COMMAND? > > where the ...:... is the expanded value of $BASH_SOURCE:$LINENO. Err, sorry about that. I misremembered. It is actually expanding to read -p "[$BASH_SOURCE:$LINENO] $BASH_COMMAND" as it woul