Re: history-search-backward clobbers history

2024-07-01 Thread Andreas Schwab
On Jun 27 2024, Chet Ramey wrote: > It took me a long time to figure this out, and it's completely dependent > on this particular set of data. You have `histappend' set (it's set by > default, but this would happen anyway because you have fewer history lines > added during that shell session than

Re: anonymous pipes in recursive function calls

2024-07-01 Thread konsolebox
On Sun, Jun 30, 2024 at 5:50 AM Zachary Santer wrote: > > > Filling an array of paths and then looping over it in a subsequent for > > > loop wouldn't actually be unreasonable here, considering how many > > > paths there are. It just feels like bad practice. > > > > Why do you think it's a bad pra

Re: history-search-backward clobbers history

2024-07-01 Thread Chet Ramey
On 7/1/24 3:54 AM, Andreas Schwab wrote: So what did change in 5.3 that this is now broken? If you want to report a bug, report one. Be specific about what you think is wrong and what you think the correct behavior is. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer

Re: history-search-backward clobbers history

2024-07-01 Thread Andreas Schwab
On Jul 01 2024, Chet Ramey wrote: > On 7/1/24 3:54 AM, Andreas Schwab wrote: > >> So what did change in 5.3 that this is now broken? > > If you want to report a bug, report one. Be specific about what you > think is wrong and what you think the correct behavior is. The correct behvious is not to

Re: function names starting with %

2024-07-01 Thread Chet Ramey
On 6/24/24 2:37 PM, Oğuz wrote: You can do these $ %f(){ :;} $ declare -f %f %f () { : } $ unset -f %f $ declare -f %f $ echo $? 1 but not call them $ %f bash: fg: %f: no such job $ '%f' bash: fg: %f: no such job $ \%f bash: fg: %f: no such job Why is that? Think of it as a built-in al

Re: history-search-backward clobbers history

2024-07-01 Thread Chet Ramey
On 7/1/24 8:40 AM, Andreas Schwab wrote: On Jul 01 2024, Chet Ramey wrote: On 7/1/24 3:54 AM, Andreas Schwab wrote: So what did change in 5.3 that this is now broken? If you want to report a bug, report one. Be specific about what you think is wrong and what you think the correct behavior i

Re: history-search-backward clobbers history

2024-07-01 Thread Andreas Schwab
The wrong thing is that the history contains commands that were never executed: echo 13456 and echo 21234. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: proposed BASH_SOURCE_PATH

2024-07-01 Thread Chet Ramey
On 6/26/24 5:59 AM, konsolebox wrote: On Tue, Jun 25, 2024 at 11:14 PM Chet Ramey wrote: On 6/19/24 6:12 PM, konsolebox wrote: Alternatively, have BASH_SOURCE always produce real physical paths either by default or through a shopt. This is the best option. I don't think changing bash to do

Re: DEBUG trap in a background shell steals controlling terminal forcing parent shell to exit

2024-07-01 Thread Mark March
Thank you for a quick fix. Bash 5.2.21 with the patch applied no longer exhibits the problem in my tests. -Mark On Thursday, June 27, 2024 at 06:05:28 AM PDT, Chet Ramey wrote: On 6/18/24 4:55 PM, Mark March wrote: > I am working with a large Bash code base where most scripts disable

«run_pending_traps: bad value in trap_list» when `jobs` is run a trap

2024-07-01 Thread Gioele Barabucci
Hi, the following script (reduced from ) #!/bin/bash childfinished () { echo "jobs: $(jobs)"; } trap childfinished SIGCHLD sleep 1 & wait causes bash 5.2.21 to output ./par.sh: line 2: warning: run_pending_traps: bad value in trap_lis

Re: anonymous pipes in recursive function calls

2024-07-01 Thread Zachary Santer
On Mon, Jul 1, 2024 at 5:06 AM konsolebox wrote: > > But then you're allowing multiple processes and pipes to be open at > the same time, unnecessarily allowing more room for unexpected errors. > Isn't that worse? It doesn't matter if bash seamlessly allows > multiple recursion-generated pipes or