Re: variable replacement text differences

2025-06-19 Thread Jeff Ketchum
I think that helps me understand the differences better, and what I am seeing. Though It doesn't seem like it is completely consistent, and not what I expected when using a variable with specific layout. (and also breaking change enabled by default) example, if i change the replacement to '\a' it

Re: variable replacement text differences

2025-06-19 Thread Lawrence Velázquez
On Thu, Jun 19, 2025, at 6:10 PM, Lawrence Velázquez wrote: > This changed in bash 5.2: > > There is a new shell option, `patsub_replacement'. When > enabled, a `&' in the replacement string of the pattern > substitution expansion is replaced by the portion of the > string

Re: variable replacement text differences

2025-06-19 Thread Lawrence Velázquez
On Thu, Jun 19, 2025, at 5:28 PM, Jeff Ketchum wrote: > $ cat replacestring.sh > original_string="1|2|3|4" > replace_string=':\\' > echo "original: ${original_string} replace:${replace_string}" > echo "unquoted ${original_string/2/${replace_string}}" > echo "quoted ${original_string/2/"${replace_

variable replacement text differences

2025-06-19 Thread Jeff Ketchum
I noticed a strange issue with some variable replacement text getting replaced in a weird way. It may be intentional. I just want to understand the differences and if it is, or if its a newer bug. Originally i was doing this to prepend data to an array like "${array_[@]/#/${variable}}" I simplifie

Re: set -e doesn't trigger when command substitutions returns, why?

2025-06-19 Thread Robert Elz
Date:Thu, 19 Jun 2025 09:27:20 +0200 From:microsuxx Message-ID: | bash -e -c 'echo $(exit 1) ; wait -n ; echo survived' You really need to stop proposing nonsense when you have no idea what is happening, or why: bash -ec 'true; wait -n; echo survived'

Re: set -e doesn't trigger when command substitutions returns, why?

2025-06-19 Thread microsuxx
bash -e -c 'echo $(exit 1) ; wait -n ; echo survived' On Thu, Jun 19, 2025, 9:25 AM microsuxx wrote: > hello there .. > to return $( and maybe <( use wait -n > > bash -e -c $'trap \'wait -n ; (( $? )) && exit 1\' debug ; echo $(exit 1) > ; echo survived' > $ u0_a427/10427 localhost 09:24:18 19.

Re: set -e doesn't trigger when command substitutions returns, why?

2025-06-19 Thread microsuxx
hello there .. to return $( and maybe <( use wait -n bash -e -c $'trap \'wait -n ; (( $? )) && exit 1\' debug ; echo $(exit 1) ; echo survived' $ u0_a427/10427 localhost 09:24:18 19.06.2025 ~ On Thu, Jun 19, 2025, 12:39 AM Никола Константинов Кралев < nkkra...@uni-sofia.bg> wrote: > ``` > u c