Re: so-called pipe files (sh-np-*) do not get deleted when processes close.

2021-03-11 Thread Chet Ramey
On 3/11/21 3:55 PM, Michael Felt (aixtools) wrote:  Sent from my iPhone On 11 Mar 2021, at 18:15, Chet Ramey wrote: On 3/11/21 11:28 AM, Michael Felt wrote: Hi, Issue: AdoptOpenJDK build process makes bash calls in a particular way. An abbreviated (shorter pathnames) example is: ``` bash

Re: unsetting associative array executes commands

2021-03-11 Thread Chet Ramey
On 3/11/21 3:50 PM, Andreas Schwab wrote: On Mär 11 2021, Chet Ramey wrote: $ cat x1 declare -A blah blah['$(DOESNOTEXIST)']=broken shopt -s assoc_expand_once touch blah\$ for i in "${!blah[@]}"; do unset blah["$i"]; done declare -p blah $ ../bash-5.1-patched/bash ./x1 declare -A blah=()

Re: unsetting associative array executes commands

2021-03-11 Thread Koichi Murase
2021年3月12日(金) 4:37 Alex fxmbsw7 Ratchev : > maybe implent a shopt -s no_expand_subshells There is already `shopt -s assoc_expand_once'. With this shell option, one can write `unset "blah[$i]"'. But such an option actually doesn't completely solve all similar cases including the associative array

Re: so-called pipe files (sh-np-*) do not get deleted when processes close.

2021-03-11 Thread Michael Felt (aixtools)
 Sent from my iPhone > On 11 Mar 2021, at 18:15, Chet Ramey wrote: > > On 3/11/21 11:28 AM, Michael Felt wrote: >> Hi, >> Issue: AdoptOpenJDK build process makes bash calls in a particular way. An >> abbreviated (shorter pathnames) example is: >> ``` >> bash-5.0$ /usr/bin/printf "Building ta

Re: unsetting associative array executes commands

2021-03-11 Thread Andreas Schwab
On Mär 11 2021, Chet Ramey wrote: > $ cat x1 > declare -A blah > blah['$(DOESNOTEXIST)']=broken > shopt -s assoc_expand_once touch blah\$ > for i in "${!blah[@]}"; do unset blah["$i"]; done > declare -p blah > $ ../bash-5.1-patched/bash ./x1 > declare -A blah=() Andreas. -- Andreas Schwab, sc

Re: unsetting associative array executes commands

2021-03-11 Thread Alex fxmbsw7 Ratchev
maybe implent a shopt -s no_expand_subshells On Thu, Mar 11, 2021 at 9:20 PM Chet Ramey wrote: > On 3/11/21 10:06 AM, Jason A. Donenfeld wrote: > > This behavior is quite surprising: > > The idea is that array subscripts undergo a uniform set of expansions when > they're used, no matter the cont

Re: unsetting associative array executes commands

2021-03-11 Thread Chet Ramey
On 3/11/21 11:38 AM, Jason A. Donenfeld wrote: Single quotes with the nested double quote? That's nuts. But okay. I guess there really is some double expansion eval-like logic happening with the unset operator. It's not an `operator' per se, it's a builtin command. That means its arguments unde

Re: unsetting associative array executes commands

2021-03-11 Thread Chet Ramey
On 3/11/21 10:06 AM, Jason A. Donenfeld wrote: This behavior is quite surprising: The idea is that array subscripts undergo a uniform set of expansions when they're used, no matter the context. Builtins already undergo word expansions as part of command execution. The result is double expansio

Re: so-called pipe files (sh-np-*) do not get deleted when processes close.

2021-03-11 Thread Chet Ramey
On 3/11/21 11:28 AM, Michael Felt wrote: Hi, Issue: AdoptOpenJDK build process makes bash calls in a particular way. An abbreviated (shorter pathnames) example is: ``` bash-5.0$ /usr/bin/printf "Building targets 'product-images legacy-jre-image test-image' in configuration 'aix-ppc64-normal

Re: unsetting associative array executes commands

2021-03-11 Thread Greg Wooledge
On Thu, Mar 11, 2021 at 09:38:37AM -0700, Jason A. Donenfeld wrote: > Single quotes with the nested double quote? That's nuts. But okay. I > guess there really is some double expansion eval-like logic happening > with the unset operator. I removed the double quotes, as they serve no purpose there.

Re: unsetting associative array executes commands

2021-03-11 Thread Jason A. Donenfeld
Single quotes with the nested double quote? That's nuts. But okay. I guess there really is some double expansion eval-like logic happening with the unset operator.

so-called pipe files (sh-np-*) do not get deleted when processes close.

2021-03-11 Thread Michael Felt
Hi, Issue: AdoptOpenJDK build process makes bash calls in a particular way. An abbreviated (shorter pathnames) example is: ``` bash-5.0$ /usr/bin/printf "Building targets 'product-images legacy-jre-image test-image' in configuration 'aix-ppc64-normal-server-release'\n" > >(/usr/bin/tee -a /

Re: unsetting associative array executes commands

2021-03-11 Thread Greg Wooledge
On Thu, Mar 11, 2021 at 08:06:55AM -0700, Jason A. Donenfeld wrote: > This behavior is quite surprising: > > $ declare -A blah > $ blah['$(DOESNOTEXIST)']=broken > $ for i in "${!blah[@]}"; do echo "$i"; done > $(DOESNOTEXIST) > $ for i in "${!blah[@]}"; do unset blah["$i"]; done > bash: DOESNOTEX

unsetting associative array executes commands

2021-03-11 Thread Jason A. Donenfeld
This behavior is quite surprising: $ declare -A blah $ blah['$(DOESNOTEXIST)']=broken $ for i in "${!blah[@]}"; do echo "$i"; done $(DOESNOTEXIST) $ for i in "${!blah[@]}"; do unset blah["$i"]; done bash: DOESNOTEXIST: command not found bash: unset: [$(DOESNOTEXIST)]: bad array subscript I wouldn