Re: Changing the way bash expands associative array subscripts

2021-04-13 Thread Koichi Murase
2021年4月13日(火) 0:16 Chet Ramey : > On 4/6/21 12:46 PM, Koichi Murase wrote: > > Looking at another thread > > https://lists.gnu.org/archive/html/bug-bash/2021-04/threads.html#00051, > > I'm now also interested in how we can handle the indirect expansions > > for 'a[@]' and the namerefs for 'a[@]': >

Re: Changing the way bash expands associative array subscripts

2021-04-13 Thread Koichi Murase
2021年4月13日(火) 18:01 Koichi Murase : > 2021年4月13日(火) 0:16 Chet Ramey : > > On 4/6/21 12:46 PM, Koichi Murase wrote: > > > Looking at another thread > > > https://lists.gnu.org/archive/html/bug-bash/2021-04/threads.html#00051, > > > I'm now also interested in how we can handle the indirect expansions

Re: Changing the way bash expands associative array subscripts

2021-04-13 Thread Chet Ramey
On 4/13/21 5:01 AM, Koichi Murase wrote: 2021年4月13日(火) 0:16 Chet Ramey : On 4/6/21 12:46 PM, Koichi Murase wrote: Looking at another thread https://lists.gnu.org/archive/html/bug-bash/2021-04/threads.html#00051, I'm now also interested in how we can handle the indirect expansions for 'a[@]' and

Bash 5.1: Completion bug fix

2021-04-13 Thread Marc Aurèle La France
Fix a bug in attempt_shell_completion() since 4.3-beta that allows the programmable completion code to override a prior decision made by attempt_shell_completion() that command completion is >not< to be used. A test case (the simplest of two possible) follows. Please Reply-To-All. Thanks. Marc.

Re: Changing the way bash expands associative array subscripts

2021-04-13 Thread L A Walsh
On 2021/04/06 08:52, Greg Wooledge wrote: In that case, I have no qualms about proposing that unset 'a[@]' and unset 'a[*]' be changed to remove only the array element whose key is '@' or '*', respectively, and screw backward compatibility. The current behavior is pointless and is nothing but a

Re: Changing the way bash expands associative array subscripts

2021-04-13 Thread konsolebox
On Wed, Apr 14, 2021 at 6:37 AM L A Walsh wrote: > So echo ${a[@]} = expansion of all, but > unset a[@] would only delete 1 element w/key '@' > how do I echo 1 element with key '@' Indeed we can only quote: a['@']=1234 echo "${a['@']}" unset "a['@']" Or have it interpreted as a value of

Re: Changing the way bash expands associative array subscripts

2021-04-13 Thread Chet Ramey
On 4/13/21 6:36 PM, L A Walsh wrote:   So echo ${a[@]} = expansion of all, but unset a[@] would only delete 1 element w/key '@' how do I echo 1 element with key '@' Creating arbitrary definitions of behavior for the similar syntax seems like a sign of random feature-ism. The behavio

Re: Changing the way bash expands associative array subscripts

2021-04-13 Thread Koichi Murase
2021年4月14日(水) 0:24 Chet Ramey : > On 4/13/21 5:01 AM, Koichi Murase wrote: > > But I expected some design consideration enabling a[$key] for an > > arbitrary key in the indirect expansions and namerefs. > > Why? Why should the shell carry around (and expect the user to remember) > information about

Re: Changing the way bash expands associative array subscripts

2021-04-13 Thread Koichi Murase
> But, If `assoc_expand_once' is needed > to make the behavior more friendly to naive users, I think we should > also take care of naive users who write « iref='a[$key]'; echo > ${!iref} ». Sorry, typo of "naive users who write « iref=a[$key]; echo ${!iref} »".