Re: Unexpected Quick Substitution in string literals

2023-12-14 Thread Chet Ramey
On 12/14/23 2:59 PM, Dale R. Worley wrote: Chet Ramey writes: While declaring a string literal across multiple lines, a line starting with the ^ character is resulting in some sort of quick substitution processing. This is a standard form of history expansion, described in the man page. I

Re: Unexpected Quick Substitution in string literals

2023-12-14 Thread Dale R. Worley
Chet Ramey writes: >> While declaring a string literal across multiple lines, a line starting >> with the ^ character is resulting in some sort of quick substitution >> processing. > > This is a standard form of history expansion, described in the man page. I just checked. Certainly, the use of

Re: Unexpected Quick Substitution in string literals

2023-12-14 Thread Chet Ramey
On 12/13/23 12:20 AM, Sundeep Agarwal wrote: Bash Version: 5.0 Patch Level: 17 Release Status: release Description: While declaring a string literal across multiple lines, a line starting with the ^ character is resulting in some sort of quick substitution processing. This is a standard

Re: Unexpected Quick Substitution in string literals

2023-12-14 Thread Greg Wooledge
On Thu, Dec 14, 2023 at 09:41:17AM +0530, Sundeep Agarwal wrote: > Thanks for the correction on my second example. I had assumed ^ wasn't > special inside double quotes since the documentation mentions only the ! > character for history expansion ( >

Re: Unexpected Quick Substitution in string literals

2023-12-13 Thread Sundeep Agarwal
Thanks for the correction on my second example. I had assumed ^ wasn't special inside double quotes since the documentation mentions only the ! character for history expansion ( https://www.gnu.org/software/bash/manual/bash.html#Double-Quotes). However, no character should be treated specially

Re: Unexpected Quick Substitution in string literals

2023-12-13 Thread Greg Wooledge
On Wed, Dec 13, 2023 at 10:50:16AM +0530, Sundeep Agarwal wrote: > $ echo "fig > ^mango" > bash: :s^mango": substitution failed I can confirm this happens in every version of bash, at least back to bash-2.05b which is as far as I can go, but only when history expansion is enabled (set -H or set

Unexpected Quick Substitution in string literals

2023-12-13 Thread Sundeep Agarwal
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/bash-Smvct5/bash-5.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-parentheses -Wno-format-security uname