Re: +=() can be used to set illegal indices

2023-07-03 Thread Chet Ramey
On 7/3/23 5:56 PM, alex xmb ratchev wrote: looked into non finite number libs ? gawk like .. ? bignums? No. intmax_t is enough for the shell. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU

Re: +=() can be used to set illegal indices

2023-07-03 Thread alex xmb ratchev
On Mon, Jul 3, 2023, 23:25 Chet Ramey wrote: > On 6/30/23 3:09 PM, Emanuele Torre wrote: > > On Fri, Jun 30, 2023 at 12:16:46PM -0400, Chet Ramey wrote: > >>> What I would have expected was something like this: > >>> > >>> $ x=([9223372036854775805]=foo) > >>> $ x+=( {1..5} ); echo "this

Re: Document m=1 m=2; echo $m result

2023-07-03 Thread alex xmb ratchev
On Mon, Jul 3, 2023, 18:22 Dennis Williamson wrote: > > > On Mon, Jul 3, 2023 at 11:11 AM alex xmb ratchev > wrote: > >> >> >> >> thats a like 30% or smth >> enuff for me >> i d be the fool typing nonsensly ; s >> > > Do what you like, but percentages don't mean anything unless you're > running

Re: +=() can be used to set illegal indices

2023-07-03 Thread Emanuele Torre
On Mon, Jul 03, 2023 at 05:24:49PM -0400, Chet Ramey wrote: > It's really more like > > a=(); a[0]=1 a[1]=2 a[2]=3 > > and the += variant omits the initial array flush. Oh, yes. I knew it, but I forgot to mention it. > > I would have expected: > > > >$ a=([1]=hi [100]=foo [-1002]=bar boo

Re: Enable compgen even when programmable completions are not available?

2023-07-03 Thread Chet Ramey
On 7/2/23 9:17 AM, Sam James wrote: The dynamic loader has to know where the library is. If you don't call readline, it shouldn't ever have to actually map it into the process. I think it still has to map it even with lazy binding, but I'm not really worried about this point much. I was

Re: +=() can be used to set illegal indices

2023-07-03 Thread Chet Ramey
On 6/30/23 3:09 PM, Emanuele Torre wrote: On Fri, Jun 30, 2023 at 12:16:46PM -0400, Chet Ramey wrote: What I would have expected was something like this: $ x=([9223372036854775805]=foo) $ x+=( {1..5} ); echo "this won't run" bash: some "invalid assignment" error $ declare -p x

Re: [BUG] Associative array initial reference name is made available in another context

2023-07-03 Thread Top Dawn
> > This is known as dynamic scoping. There is text in the manual describing > it. > Thank you, this was an interesting read. :) Best, On Mon, Jul 3, 2023 at 2:59 PM Chet Ramey wrote: > On 7/2/23 9:04 AM, Top Dawn wrote: > >> > >> What makes you think so? Variables are always visible in

Re: Document m=1 m=2; echo $m result

2023-07-03 Thread Dennis Williamson
On Mon, Jul 3, 2023 at 11:11 AM alex xmb ratchev wrote: > > > > thats a like 30% or smth > enuff for me > i d be the fool typing nonsensly ; s > Do what you like, but percentages don't mean anything unless you're running a lot of assignments in a loop like the artificial conditions in the test

Re: Document m=1 m=2; echo $m result

2023-07-03 Thread alex xmb ratchev
On Mon, Jul 3, 2023, 18:01 Dennis Williamson wrote: > > > On Mon, Jul 3, 2023 at 10:32 AM alex xmb ratchev > wrote: > >> >> i chain assignments , have impression its faster >> >> kre >> > >> > >> > >> > > Tests are better than impressions. Sometimes they match though. > > $ time for ((i = 0; i

Re: Enable compgen even when programmable completions are not available?

2023-07-03 Thread Chet Ramey
On 7/3/23 2:33 AM, Fabian Groffen wrote: This is a Gentoo-specific problem. When we are bootstrapping a Prefix, we need an updated bash very early on in the process. On some systems, we experienced compilation failures in the readline component. Since this interactive part isn't important at

Re: Document m=1 m=2; echo $m result

2023-07-03 Thread Dennis Williamson
On Mon, Jul 3, 2023 at 10:32 AM alex xmb ratchev wrote: > > i chain assignments , have impression its faster > > kre > > > > > > > Tests are better than impressions. Sometimes they match though. $ time for ((i = 0; i <= 100; i++)); do j=$i; k=$j; m=10; n=foobarbazqux; p=100; q=$n;

Re: [PATCH] sleep builtin signal handling

2023-07-03 Thread Chet Ramey
On 6/30/23 2:06 AM, Grisha Levit wrote: The sleep builtin currently doesn't do much in the way of signal management, so for example it will return on SIGWINCH, which I think most users will be particularly surprised by the first time they notice a sleep ending early due to a window resize. I

Re: Document m=1 m=2; echo $m result

2023-07-03 Thread alex xmb ratchev
On Mon, Jul 3, 2023, 14:41 Robert Elz wrote: > Date:Sun, 2 Jul 2023 21:04:38 -0400 > From:Greg Wooledge > Message-ID: > > | The first assignment is done before the value of "m" is used in the > second > | assignment. > > Note that that is a shell specific

Re: [BUG] Associative array initial reference name is made available in another context

2023-07-03 Thread Chet Ramey
On 7/2/23 9:04 AM, Top Dawn wrote: What makes you think so? Variables are always visible in invoked functions, unless you shadow them using local/declare/typeset. Thank you very much for this information, I didn't know invoked functions inherited their parent functions variables. This is

Re: Document m=1 m=2; echo $m result

2023-07-03 Thread Robert Elz
Date:Sun, 2 Jul 2023 21:04:38 -0400 From:Greg Wooledge Message-ID: | The first assignment is done before the value of "m" is used in the second | assignment. Note that that is a shell specific feature, applies to bash, but not necessarily to other shells (some

Re: Enable compgen even when programmable completions are not available?

2023-07-03 Thread Fabian Groffen
On 02-07-2023 14:17:28 +0100, Sam James wrote: > > Chet Ramey writes: > > > On 6/29/23 11:16 PM, Eli Schwartz wrote: > > > >> I assume that, given the option exists in the configure script, there > >> are people who will want to use the option made available to them. One > >> reason might be