5.1 locale.c typos?

2021-01-11 Thread Henry Bent
locale.c: In function 'set_default_locale': locale.c:94:3: error: 'local_shiftstates' undeclared (first use in this function) local_shiftstates = 0; ^ locale.c:94:3: note: each undeclared identifier is reported only once for each function it appears in locale.c: In function 'set_default_local

Re: bug-bash Digest, Vol 218, Issue 13

2021-01-11 Thread Thomas Mellman
On 1/10/21 6:00 PM, bug-bash-requ...@gnu.org wrote: Message: 3 Date: Sun, 10 Jan 2021 16:49:50 +0100 From: Ángel To: bug-bash@gnu.org Subject: Re: non-executable files in $PATH cause errors Message-ID: <94646752576f053515ac2ba4656fe0c895f348ce.ca...@16bits.net> Content-Type: text/plain

Re: Associative array keys are not reusable in (( command

2021-01-11 Thread Oğuz
11 Ocak 2021 Pazartesi tarihinde Chet Ramey yazdı: > On 1/11/21 11:33 AM, Oğuz wrote: > >> >> >> 11 Ocak 2021 Pazartesi tarihinde Chet Ramey > chet.ra...@case.edu>> yazdı: >> >> What semantics would you choose to change? >> >> >> If you are reluctant to change semantics, how about a new param

Re: Associative array keys are not reusable in (( command

2021-01-11 Thread Greg Wooledge
> > If you are reluctant to change semantics, how about a new parameter > > transformation to quote values using `sh_single_quote'? > > Why, when @Q already exists? It's often the case that the strings generated by bash are being fed to some other shell, where $'...' doesn't work. Granted, you c

Re: Associative array keys are not reusable in (( command

2021-01-11 Thread Chet Ramey
On 1/11/21 11:33 AM, Oğuz wrote: 11 Ocak 2021 Pazartesi tarihinde Chet Ramey > yazdı: What semantics would you choose to change? If you are reluctant to change semantics, how about a new parameter transformation to quote values using `sh_single_quote'? Why

Re: Associative array keys are not reusable in (( command

2021-01-11 Thread Oğuz
11 Ocak 2021 Pazartesi tarihinde Chet Ramey yazdı: > > What semantics would you choose to change? > If you are reluctant to change semantics, how about a new parameter transformation to quote values using `sh_single_quote'? -- Oğuz

Re: Associative array keys are not reusable in (( command

2021-01-11 Thread Oğuz
11 Ocak 2021 Pazartesi tarihinde Léa Gris yazdı: > > safe_arith_index=${x@Q} > This won't work if `x' contains a newline or a tab or something that makes bash resort to $'...' strings. See my first post. -- Oğuz

Re: Associative array keys are not reusable in (( command

2021-01-11 Thread Greg Wooledge
On Mon, Jan 11, 2021 at 03:50:40PM +0100, Léa Gris wrote: > safe_arith_index=${x@Q} > declare -p safe_arith_index > > declare -- safe_arith_index="'y[\$(date >&2)0]'" > (( aa[$safe_arith_index]++ )) > declare -p aa > > declare -Ai aa=(["y[\$(date >&2)0]"]="3" ) OK, that one has potential, since it

Re: Associative array keys are not reusable in (( command

2021-01-11 Thread Léa Gris
Le 11/01/2021 à 15:42, Léa Gris écrivait : Declare an integer associative array instead: echo "$BASH_VERSION" 5.0.17(1)-release declare -Ai aa x='y[$(date >&2)0]' aa[$x]=1 declare -p aa declare -Ai aa=(["y[\$(date >&2)0]"]="1" ) aa[$x]+=1 declare -p aa declare -Ai aa=(["y[\$(date >&2)0]"]="

Re: Associative array keys are not reusable in (( command

2021-01-11 Thread Léa Gris
Declare an integer associative array instead: echo "$BASH_VERSION" 5.0.17(1)-release declare -Ai aa x='y[$(date >&2)0]' aa[$x]=1 declare -p aa declare -Ai aa=(["y[\$(date >&2)0]"]="1" ) aa[$x]+=1 declare -p aa declare -Ai aa=(["y[\$(date >&2)0]"]="2" ) -- Léa Gris

Re: Associative array keys are not reusable in (( command

2021-01-11 Thread Chet Ramey
> So what I'm hearing is: We hear what we choose, I suppose. What semantics would you choose to change? -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~

Re: Associative array keys are not reusable in (( command

2021-01-11 Thread Greg Wooledge
On Mon, Jan 11, 2021 at 09:07:08AM -0500, Chet Ramey wrote: > On 1/10/21 2:55 PM, Oğuz wrote: > > > If I don't know the key beforehand, like if I read it from a file or the > > like, this becomes a security issue. That is my concern, > > `assoc_expand_once' doesn't help in that situation. > > If

Re: Associative array keys are not reusable in (( command

2021-01-11 Thread Chet Ramey
On 1/10/21 2:55 PM, Oğuz wrote: If I don't know the key beforehand, like if I read it from a file or the like, this becomes a security issue. That is my concern, `assoc_expand_once' doesn't help in that situation. If you're taking input that you haven't verified and putting it into an expansi