Re: parsing command substitution inside parameter expansion in interactive shell

2023-05-24 Thread Chet Ramey
On 5/23/23 2:50 PM, Grisha Levit wrote: One more similar case when the parameter expansion is quoted: bash --norc -in <<<$'"${_+$("\n")}"' bash-5.2$ "${_+$(" bash: command substitution: line 2: unexpected EOF while looking for matching `"' > ")}" bash --norc -in <<<$'"${_+$(:\n)}"' bash-5.2

Re: parsing command substitution inside parameter expansion in interactive shell

2023-05-23 Thread Grisha Levit
On Mon, Mar 20, 2023 at 4:59 PM Chet Ramey wrote: > Thanks for the report. This is the same thing as > > https://lists.gnu.org/archive/html/bug-bash/2021-06/msg00115.html > > with the command substitution being embedded in the parameter expansion. One more similar case when the parameter expansio

Re: parsing command substitution inside parameter expansion in interactive shell

2023-03-25 Thread Grisha Levit
On Mon, Mar 20, 2023 at 4:59 PM Chet Ramey wrote: > Thanks, it's an easy fix to preserve the newline here. FWIW even with the latest fixes, this kind of nesting in a history entry still triggers ASAN: bash --norc -in <<<$'${_+$(\n \cP\en ' ERROR: AddressSanitizer: heap-buffer-overflow READ of s

Re: parsing command substitution inside parameter expansion in interactive shell

2023-03-20 Thread Chet Ramey
On 3/19/23 9:58 PM, Grisha Levit wrote: If a command substitution inside a parameter expansion has a command followed by a newline, bash prints an error message (though the command is parsed and saved in the history list correctly): Thanks for the report. This is the same thing as https://list

parsing command substitution inside parameter expansion in interactive shell

2023-03-19 Thread Grisha Levit
If a command substitution inside a parameter expansion has a command followed by a newline, bash prints an error message (though the command is parsed and saved in the history list correctly): bash --norc -in <<<$'${_+$(:\n)}\n!!' $ ${_+$(: bash: command substitution: line 3: unexpected EOF while