Re: New array_expand_once option

2023-06-19 Thread alex xmb ratchev
On Mon, Jun 19, 2023, 22:13 Chet Ramey wrote: > On 6/19/23 3:42 PM, alex xmb ratchev wrote: > > > in short , i no [ and no compat .. > > leaving 2 out of 4 answers of u > > What does that mean? > ah oh u answered a bunch in batch just saying [ and compat i dont use leaving two other answers of u

Re: New array_expand_once option

2023-06-19 Thread Chet Ramey
On 6/19/23 3:42 PM, alex xmb ratchev wrote: in short , i no [ and no compat .. leaving 2 out of 4 answers of u What does that mean? -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRUc...@case.edu

Re: New array_expand_once option

2023-06-19 Thread alex xmb ratchev
On Mon, Jun 19, 2023, 19:44 Chet Ramey wrote: > On 6/17/23 11:08 AM, alex xmb ratchev wrote: > > > To better describe its functionality, I renamed assoc_expand_once to > > array_expand_once. The old name is still accepted. > > > > > > its an opt that have manually to be enabled ? > > or i

Re: New array_expand_once option

2023-06-19 Thread Chet Ramey
On 6/17/23 11:08 AM, alex xmb ratchev wrote: To better describe its functionality, I renamed assoc_expand_once to array_expand_once. The old name is still accepted. its an opt that have manually to be enabled ? or is by default on It's off by default. When the next version of b

Re: New array_expand_once option

2023-06-19 Thread Chet Ramey
On 6/17/23 8:46 AM, Dennis Williamson wrote: On Sat, Jun 17, 2023, 6:59 AM alex xmb ratchev wrote: On 6/14/23 5:18 PM, alex xmb ratchev wrote: [[ -v a["$subscript"] ]] a small question about that .. do the quotes matter ? Try it without the quotes and with an empty or unset

Re: New array_expand_once option

2023-06-19 Thread Chet Ramey
On 6/17/23 7:58 AM, alex xmb ratchev wrote: On Thu, Jun 15, 2023, 20:40 alex xmb ratchev > wrote: On Thu, Jun 15, 2023, 15:06 Chet Ramey mailto:chet.ra...@case.edu>> wrote: On 6/14/23 5:18 PM, alex xmb ratchev wrote: >     [[ -v a["$subscript

Re: New array_expand_once option

2023-06-17 Thread alex xmb ratchev
On Tue, Jun 13, 2023, 22:21 Chet Ramey wrote: > The latest push to the devel branch extends the assoc_expand_once > semantics to indexed array variables. This means that a construct > like > > export subscript='$(uname >&2 ; echo 0)' > shopt -s assoc_expand_once > printf -v a["$subscript"] %s hi

Re: New array_expand_once option

2023-06-17 Thread alex xmb ratchev
On Sat, Jun 17, 2023, 14:46 Dennis Williamson wrote: > > > On Sat, Jun 17, 2023, 6:59 AM alex xmb ratchev wrote: > >> On Thu, Jun 15, 2023, 20:40 alex xmb ratchev wrote: >> >> > >> > >> > On Thu, Jun 15, 2023, 15:06 Chet Ramey wrote: >> > >> >> On 6/14/23 5:18 PM, alex xmb ratchev wrote: >> >>

Re: New array_expand_once option

2023-06-17 Thread Dennis Williamson
On Sat, Jun 17, 2023, 6:59 AM alex xmb ratchev wrote: > On Thu, Jun 15, 2023, 20:40 alex xmb ratchev wrote: > > > > > > > On Thu, Jun 15, 2023, 15:06 Chet Ramey wrote: > > > >> On 6/14/23 5:18 PM, alex xmb ratchev wrote: > >> > >> > [[ -v a["$subscript"] ]] > >> > > > a small question about

Re: New array_expand_once option

2023-06-17 Thread alex xmb ratchev
On Thu, Jun 15, 2023, 20:40 alex xmb ratchev wrote: > > > On Thu, Jun 15, 2023, 15:06 Chet Ramey wrote: > >> On 6/14/23 5:18 PM, alex xmb ratchev wrote: >> >> > [[ -v a["$subscript"] ]] >> > a small question about that .. do the quotes matter ? > >> > is already an arithmetic expansion

Re: New array_expand_once option

2023-06-15 Thread alex xmb ratchev
On Thu, Jun 15, 2023, 15:06 Chet Ramey wrote: > On 6/14/23 5:18 PM, alex xmb ratchev wrote: > > > [[ -v a["$subscript"] ]] > > > > is already an arithmetic expansion error in bash-5.2, but not in > bash-5.1. > > > > > > hello there .. > > > > i dont get much > > it d be an arith err if ar

Re: New array_expand_once option

2023-06-15 Thread Chet Ramey
On 6/14/23 5:18 PM, alex xmb ratchev wrote: [[ -v a["$subscript"] ]] is already an arithmetic expansion error in bash-5.2, but not in bash-5.1. hello there .. i dont get much it d be an arith err if array wasnt -A .. ? Yes, because only one expansion is performed, and so the subscr

Re: New array_expand_once option

2023-06-14 Thread alex xmb ratchev
On Wed, Jun 14, 2023, 15:34 Chet Ramey wrote: > On 6/13/23 7:12 PM, alex xmb ratchev wrote: > > > any word s about [[ -v > > .. ? > > > > Using the assignments above, > > [[ -v a["$subscript"] ]] > > is already an arithmetic expansion error in bash-5.2, but not in bash-5.1. > hello there .. i d

Re: New array_expand_once option

2023-06-14 Thread Chet Ramey
On 6/13/23 7:12 PM, alex xmb ratchev wrote: any word s about [[ -v .. ? Using the assignments above, [[ -v a["$subscript"] ]] is already an arithmetic expansion error in bash-5.2, but not in bash-5.1. Inhibiting double expansions like those for shell compound commands was one of the changes

Re: New array_expand_once option

2023-06-13 Thread alex xmb ratchev
On Tue, Jun 13, 2023, 22:21 Chet Ramey wrote: > The latest push to the devel branch extends the assoc_expand_once > semantics to indexed array variables. This means that a construct > like > > export subscript='$(uname >&2 ; echo 0)' > shopt -s assoc_expand_once > printf -v a["$subscript"] %s hi

New array_expand_once option

2023-06-13 Thread Chet Ramey
The latest push to the devel branch extends the assoc_expand_once semantics to indexed array variables. This means that a construct like export subscript='$(uname >&2 ; echo 0)' shopt -s assoc_expand_once printf -v a["$subscript"] %s hi declare -p a will no longer run `uname' and assign "hi" to