Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15516

Re: Feature request: save/restore BASH_REMATCH across debug hook calls

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: Feature request: save/restore BASH_REMATCH across debug hook calls
Date 2019-10-16 15:14 -0400
Organization ITS, Case Western Reserve University
Message-ID <mailman.903.1571253292.9715.bug-bash@gnu.org> (permalink)
References <CANCp2gZjUeDUbRDVZzjqMVn1eWoRXRK+kTf_y-UHWTs5R6a79Q@mail.gmail.com> <29baca4d-b3fe-c50a-0b59-47214cd8d418@case.edu>

Show all headers | View raw


On 10/16/19 1:34 PM, Rocky Bernstein wrote:
> Current in bash 5.0 and earlier, the value of BASH_REMATCH might chanted
> inside a debug hook.
> 
> Since BASH_REMATCH is read-only, resetting the value on hook return to the
> debugged program is a bit tricky and fragile...

How about we just make it not read-only? The shell will still set it when
it does regexp matching.

-- 
``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/

Back to gnu.bash.bug | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Feature request: save/restore BASH_REMATCH across debug hook calls Chet Ramey <chet.ramey@case.edu> - 2019-10-16 15:14 -0400
  Re: Feature request: save/restore BASH_REMATCH across debug hook calls rocky.bernstein@gmail.com - 2019-10-17 00:08 -0700

csiph-web