Re: bash encountered a coredump issue with stepping on memory

2023-12-11 Thread wang yuhang
> Is this at the same point as the core dump in your previous message? yes

Re: $((expr)) allows the hexadecimal constant "0x"

2023-12-11 Thread Zachary Santer
On Sun, Dec 10, 2023 at 3:56 PM Chet Ramey wrote: > Come on. Bash (and POSIX) define arithmetic in terms of how C does it, > and that is an invalid C integer constant. It's not even shell-specific > syntax like base#number; it's something that C defines. Is it worth it > trying to be helpful, or i

Re: Sv: TAB completion bug

2023-12-11 Thread Chet Ramey
On 12/10/23 7:23 PM, Ole Tange wrote: *Fra:* Chet Ramey On 12/5/23 6:46 PM, Ole Tange via Bug reports for the GNU Bourne Again SHell wrote:   For the (admitedly weirdly named) dirs below TAB completion does not work correctly. Thanks for the report. Where did you encounter these dire

Re: $((expr)) allows the hexadecimal constant "0x"

2023-12-11 Thread Chet Ramey
On 12/11/23 7:49 AM, Zachary Santer wrote: On Sun, Dec 10, 2023 at 3:56 PM Chet Ramey wrote: Come on. Bash (and POSIX) define arithmetic in terms of how C does it, and that is an invalid C integer constant. It's not even shell-specific syntax like base#number; it's something that C defines. Is

Re: $((expr)) allows the hexadecimal constant "0x"

2023-12-11 Thread Chet Ramey
On 12/9/23 9:15 PM, Zachary Santer wrote: Bash 4.2 on RHEL 7. Part of the issue here is that distros -- Red Hat, at least -- never upgrade the version of bash they started with. Red Hat will `support' bash-4.2 as long as they support RHEL 7. -- ``The lyf so short, the craft so long to lerne.'

Re: $((expr)) allows the hexadecimal constant "0x"

2023-12-11 Thread Chet Ramey
On 12/10/23 12:12 AM, Martin D Kealey wrote: And sometimes Bash isn't the thing that needs fixing. Maybe the manual needs to be clearer that "#" is not an "operator" like "+" or "/" but rather part of an unsigned integer constant (and that "-" is NOT part of such a constant). That syntax is

Re: $((expr)) allows the hexadecimal constant "0x"

2023-12-11 Thread Chet Ramey
On 12/10/23 1:58 AM, Koichi Murase wrote: It's too late, but a better way could have been introducing the function-call syntax and supporting signed n-adic numbers through e.g. « int([-+]digits, n) ». You're 40 years too late. The [base#]number syntax was in ksh-83. -- ``The lyf so short, the

Re: $((expr)) allows the hexadecimal constant "0x"

2023-12-11 Thread Koichi Murase
2023年12月11日(月) 23:37 Chet Ramey : > On 12/10/23 1:58 AM, Koichi Murase wrote: > > It's too late, but a better way could have been introducing the > > function-call syntax and supporting signed n-adic numbers through e.g. > > « int([-+]digits, n) ». > > You're 40 years too late. The [base#]number sy

Ability to display parameters as global with `declare -gp`

2023-12-11 Thread Albert Akchurin
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 uname output: Linux fs 6.5.11-7-pve #1 SMP PREEMPT_DYNAMIC PMX 6.5.11-7 (2023-12-05T09:44Z) x86_64 GNU/Linux Machine Type: x86_64-pc-linux-gnu Bash Vers

`declare -f` incorrectly displays `coproc` statement

2023-12-11 Thread Albert Akchurin
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 uname output: Linux fs 6.5.11-7-pve #1 SMP PREEMPT_DYNAMIC PMX 6.5.11-7 (2023-12-05T09:44Z) x86_64 GNU/Linux Machine Type: x86_64-pc-linux-gnu Bash Vers

Re: Make reverse-i-search failure joltingly clear

2023-12-11 Thread Chet Ramey
On 12/11/23 2:09 AM, Dan Jacobson wrote: Type ^R and some string, At the point while we are typing that the search fails, all that happens is the word "failed" gets added at front, No, readline rings the bell as well. If you want it to use a visible bell instead, change the value of the readlin

Re: bash encountered a coredump issue with stepping on memory

2023-12-11 Thread Chet Ramey
On 12/11/23 6:20 AM, wang yuhang wrote: Is this at the same point as the core dump in your previous message? yes OK, then I would recommend building an asan-enabled version of bash and seeing what it tells you. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer `

Re: $((expr)) allows the hexadecimal constant "0x"

2023-12-11 Thread Greg Wooledge
On Tue, Dec 12, 2023 at 12:10:02AM +0900, Koichi Murase wrote: > https://lists.gnu.org/archive/html/bug-bash/2019-06/threads.html#00039 Four years later, i=$(( ${i%%[!+-]*}10#${i#[-+]} )) is still horrible. Well, to be fair, five years since the original suggestion

Re: $((expr)) allows the hexadecimal constant "0x"

2023-12-11 Thread Steffen Nurpmeso
Chet Ramey wrote in : ... |It's still accepted in the devel branch, unless STRICT_ARITH_PARSING is |defined. There was a discussion about it in 2022: | |https://lists.gnu.org/archive/html/bug-bash/2022-07/msg00045.html You surely mean https://lists.gnu.org/archive/html/bug-bash/2022-07/ms

Re: $((expr)) allows the hexadecimal constant "0x"

2023-12-11 Thread Chet Ramey
On 12/11/23 2:19 PM, Steffen Nurpmeso wrote: Chet Ramey wrote in : ... |It's still accepted in the devel branch, unless STRICT_ARITH_PARSING is |defined. There was a discussion about it in 2022: | |https://lists.gnu.org/archive/html/bug-bash/2022-07/msg00045.html You surely mean

Re: $((expr)) allows the hexadecimal constant "0x"

2023-12-11 Thread Zachary Santer
On Mon, Dec 11, 2023 at 9:26 AM Chet Ramey wrote: > Part of the issue here is that distros -- Red Hat, at least -- never > upgrade the version of bash they started with. Red Hat will `support' > bash-4.2 as long as they support RHEL 7. To be fair to the Red Hat people, "my scripts used to work and

Re: $((expr)) allows the hexadecimal constant "0x"

2023-12-11 Thread Chet Ramey
On 12/11/23 2:56 PM, Zachary Santer wrote: On Mon, Dec 11, 2023 at 9:26 AM Chet Ramey wrote: Part of the issue here is that distros -- Red Hat, at least -- never upgrade the version of bash they started with. Red Hat will `support' bash-4.2 as long as they support RHEL 7. To be fair to the Red

Re: `declare -f` incorrectly displays `coproc` statement

2023-12-11 Thread Chet Ramey
On 12/11/23 9:41 AM, Albert Akchurin wrote: Machine Type: x86_64-pc-linux-gnu Bash Version: 5.2 Patch Level: 21 Description: `declare -f` wrongly displays the `coproc my_command` statement. Thanks for the report. I agree that command printing should omit the coproc name if the c

Re: $((expr)) allows the hexadecimal constant "0x"

2023-12-11 Thread Martin D Kealey
On Mon, 11 Dec 2023 at 06:55, Chet Ramey wrote: > It came up as a bug report in > > https://lists.gnu.org/archive/html/bug-bash/2019-06/mstheng00042.html > > > (part of the followup discussion after the second linked thread above

Re: $((expr)) allows the hexadecimal constant "0x"

2023-12-11 Thread Koichi Murase
2023年12月10日(日) 15:58 Koichi Murase : > 2023年12月10日(日) 14:13 Martin D Kealey : > > But even if you still thought this was worth doing, it wasn't necessary to > > make $((10#)) completely illegal: Bash could look ahead and only intervene > > if the following character is '-' (affecting $((10#-digits)