Re: Arithmetic expression: interest in unsigned right shift?

2022-07-18 Thread Martin D Kealey
On Sun, 17 Jul 2022 at 17:01, Robert Elz wrote: > For just getting the word size, a better solution would be to request a > new predefined variable (eg: BASH_ARITH_BITS) which contains the number > of bits used for arithmetic. Inventing new mechanisms so you can compute > it dynamically is craz

Re: Arithmetic expression: interest in unsigned right shift?

2022-07-18 Thread Steffen Nurpmeso
Chet Ramey wrote in : |On 7/16/22 1:44 PM, Steffen Nurpmeso wrote: |> 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? I

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

2022-07-18 Thread Chet Ramey
On 7/18/22 2:11 AM, Koichi Murase wrote: 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 a

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

2022-07-18 Thread Martin Schulte
Hello Chet, on 2022-07-18 10:26:05 -0400 you wrote: > On 7/16/22 11:18 AM, Martin Schulte wrote: > > Hello, > > > > I'm just wondering that bash (reproduced with 5.2-rc1 under Debian 11) > > seems to determine LINES and COLUMNS from stderr. > > ... > When it's not interactive, all bets are off

Re: local -r issue in conjunction with trap

2022-07-18 Thread Chet Ramey
On 7/17/22 6:48 PM, Koichi Murase wrote: 1) "set -e" is set. 2) The code is executed from a script file. 3) Shadowing of local readonly variables is attempted in a trap handler. This exact set of conditions, plus the requirement that it must be an exit trap handler and the `exit' builtin must

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

2022-07-18 Thread Chet Ramey
On 7/16/22 11:18 AM, Martin Schulte wrote: Hello, I'm just wondering that bash (reproduced with 5.2-rc1 under Debian 11) seems to determine LINES and COLUMNS from stderr. It uses stderr because if the shell is interactive, stderr is guaranteed to be a terminal, and that's the file descriptor

Re: local -r issue in conjunction with trap

2022-07-18 Thread Chet Ramey
On 7/17/22 6:48 PM, Koichi Murase wrote: 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 variab