[PATCH] Fix leaked internal escapes of patsub_replacement ${var/$pat/"&"} with pat=# or pat=%

2022-07-17 Thread Koichi Murase
Here is another patch that was pending. Bash Version: 5.2 Commit 87a6e89edc7cb1af057e2c15666df189595d305b (the current devel) Description: When `shopt -s patsub_replacement' is turned on and the pattern string `pat' of ${var/$pat/"&"} is just an anchoring character `#' or `%', the internal

Re: [PATCH] Fix foreground dead jobs in trap handlers reported like background ones in `jobs'

2022-07-17 Thread Koichi Murase
2022年7月18日(月) 12:52 Koichi Murase : > Description: > > In interactive shells, the foreground dead jobs (i.e., foreground > jobs that have already terminated) in trap handlers, commands called > through `bind -x', and `PROMPT_COMMAND' (...) are treated as > if they are the background dead jo

[PATCH] Fix foreground dead jobs in trap handlers reported like background ones in `jobs'

2022-07-17 Thread Koichi Murase
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -Wno-parentheses -Wno-format-security uname output: Linux chatoyancy 5.6.13-100.fc30.x86_64 #1 SMP Fri May 15 00:36:06 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux M

Re: local -r issue in conjunction with trap

2022-07-17 Thread Koichi Murase
2022年7月18日(月) 6:40 Chet Ramey : > On 7/15/22 7:06 PM, Koichi Murase wrote: > > We can shadow local readonly variables. What we cannot are global > > readonly variables. > > > > It seems to me a bug. > > It's not a bug. Bash-2.04 introduced behavior to disallow local variables > with the same name a

Re: local -r issue in conjunction with trap

2022-07-17 Thread Chet Ramey
On 7/15/22 7:06 PM, Koichi Murase wrote: 2022年7月16日(土) 7:28 Lawrence Velázquez : You can't shadow a readonly variable: https://lists.gnu.org/archive/html/bug-bash/2019-03/msg00152.html https://lists.gnu.org/archive/html/bug-bash/2019-03/msg00153.html https://lists.gnu.org/archive/html/bug-bash/

Re: Arithmetic expression: interest in unsigned right shift?

2022-07-17 Thread Chet Ramey
On 7/17/22 12:13 AM, Martin D Kealey wrote: Printf %u already reveals the word size, as do most kinds of overflow - albeit messily, like $((3**40)) At least by explicitly exposing the word size in a controlled manner, we can write code that avoids unintended overflow. This is not a problem in

Re: Arithmetic expression: interest in unsigned right shift?

2022-07-17 Thread Chet Ramey
On 7/16/22 1:44 PM, Steffen Nurpmeso wrote: Hello. I realized there is no unsigned right shift in bash arithmetic expression, and thought maybe there is interest. Thanks. There aren't any unsigned operators in shell arithmetic now, what makes this one necessary? Chet -- ``The lyf so short, t

Re: Gettings LINES and COLUMNS from stderr instead of /dev/tty

2022-07-17 Thread Martin Schulte
Hello Dale! > Martin Schulte writes: > > I'm just wondering that bash (reproduced with 5.2-rc1 under Debian 11) > > seems to determine LINES and COLUMNS from stderr. > > It's not clear to me that the manual page says where the LINES and > COLUMNS values are obtained from. Sorry, maybe my mail w

Re: Arithmetic expression: interest in unsigned right shift?

2022-07-17 Thread Robert Elz
Date:Sun, 17 Jul 2022 14:13:16 +1000 From:Martin D Kealey Message-ID: | At least by explicitly exposing the word size in a controlled manner, we | can write code that avoids unintended overflow. For just getting the word size, a better solution would be to requ