Re: Bash 5.2.21 segfaults when I feed it garbage

2024-01-12 Thread Chet Ramey
On 1/10/24 2:06 PM, Grisha Levit wrote: Rewriting the original report as: bash <<<'((X=([))' even after the last fix, there's still a similar issue with input like: bash <<<'((X=([))]' Thanks for the report. I debated whether or not to do error handling before restoring the

Re: nofork command substitution bugs

2024-01-12 Thread Chet Ramey
On 1/12/24 1:06 PM, Oğuz wrote: Why would that be unexpected, since you're explicitly running something in the calling shell's context, with the expected side effects to that environment? I wasn't clear. This doesn't exit the shell bash-5.3$ exec foo bash: exec: foo: not found

Re: document that read built-in can't return zero-length string in the middle of input

2024-01-12 Thread Greg Wooledge
On Sat, Jan 13, 2024 at 02:06:08AM +0700, Robert Elz wrote: > Date:Fri, 12 Jan 2024 07:15:35 -0500 > From:Greg Wooledge > Message-ID: > > | This was one of the things I tested: > > Perhaps intended to, but didn't, or not in this example: > > | { read -N1; read

Re: document that read built-in can't return zero-length string in the middle of input

2024-01-12 Thread Lawrence Velázquez
On Fri, Jan 12, 2024, at 2:06 PM, Robert Elz wrote: > ps: the use of process substitution there is just silly, it would work > just as well, and be easier to understand if written: > > printf '\\\nabc' | { read -N1; read -r b c; }; declare -p REPLY b c Presumably Greg was just preventing

Re: document that read built-in can't return zero-length string in the middle of input

2024-01-12 Thread Robert Elz
Date:Fri, 12 Jan 2024 07:15:35 -0500 From:Greg Wooledge Message-ID: | This was one of the things I tested: Perhaps intended to, but didn't, or not in this example: | { read -N1; read -r b c; } < <(printf \\nabc); declare -p REPLY a b c Rewrite that, correctly

Re: nofork command substitution bugs

2024-01-12 Thread Oğuz
On Fri, Jan 12, 2024 at 7:05 PM Chet Ramey wrote: > Nofork command substitution freezes the jobs list, because you don't > want jobs appearing and disappearing in the list while you're running > word expansion. If the jobs list is frozen, wait -n doesn't even try > waiting, since you don't want

Re: No filename expansion in shell-expand-line

2024-01-12 Thread Chet Ramey
On 1/12/24 3:28 AM, Martin Schulte wrote: Hello, from the documentation I understand that shell-expand-line (ESC CTRL-E) should do alias expansion, history expansion, brace expansion, tilde expansion, shell parameter expansion, command substitution, arithmetic expansion, process substitution

Re: nofork command substitution bugs

2024-01-12 Thread Chet Ramey
On 1/4/24 8:36 AM, Oğuz wrote: These bugs affect the development branch only. 1. `wait -n' doesn't work inside nofork command substitution. I think it should, or wait without `-n' shouldn't work either, or what works and what doesn't should be documented. Nofork command substitution freezes

Re: document that read built-in can't return zero-length string in the middle of input

2024-01-12 Thread Greg Wooledge
On Fri, Jan 12, 2024 at 03:26:31PM +0700, Robert Elz wrote: > Date:Thu, 11 Jan 2024 20:02:04 -0500 > From:Greg Wooledge > Message-ID: > > | What actually counts is how many > | characters are *stored* in the variable, not how many characters are > | *read*

Re: No filename expansion in shell-expand-line

2024-01-12 Thread Martin Schulte
Sorry, I falied to copy and paste R*, the last line is replaced by ls --color=auto echo {a..c} ~root xterm-256color 2024-01-12 42 /dev/fd/63 hello R* > Hello, > > from the documentation I understand that shell-expand-line (ESC CTRL-E) > should do alias expansion, history expansion, brace

No filename expansion in shell-expand-line

2024-01-12 Thread Martin Schulte
Hello, from the documentation I understand that shell-expand-line (ESC CTRL-E) should do alias expansion, history expansion, brace expansion, tilde expansion, shell parameter expansion, command substitution, arithmetic expansion, process substitution (if supported by the operation system),

Re: document that read built-in can't return zero-length string in the middle of input

2024-01-12 Thread Robert Elz
Date:Thu, 11 Jan 2024 20:02:04 -0500 From:Greg Wooledge Message-ID: | What actually counts is how many | characters are *stored* in the variable, not how many characters are | *read* from the input. I suspect that is the root of the issue here, you're