Re: How is it explained about the `local` is valid variable

2020-11-24 Thread Lawrence Velázquez
> On Nov 24, 2020, at 8:06 PM, Budi wrote: > > Can we validly write a line > > unset local a b c d e f g h i > > to mean: local a b c d e f g h i;unset a b c d e f g h i No. Have you looked at the documentation for "unset"? vq P.S. Again, not a bug. Not appropriate for bug-bash.

How is it explained about the `local` is valid variable

2020-11-24 Thread Budi
Can we validly write a line unset local a b c d e f g h i to mean: local a b c d e f g h i;unset a b c d e f g h i if yes, how come local=9 is valid variable 'local' normally ? thanks much

RE: increment & decrement error when variable is 0

2020-11-24 Thread Jetzer, Bill
Thank you for the clarification. I understand now. --bill From: Ilkka Virta Sent: Tuesday, November 24, 2020 2:08 AM To: Jetzer, Bill Cc: bug-bash@gnu.org Subject: Re: increment & decrement error when variable is 0 On Tue, Nov 24, 2020 at 12:07 AM Jetzer, Bill

Re: Variables declared in arithmetic expressions have no i flag

2020-11-24 Thread Greg Wooledge
On Tue, Nov 24, 2020 at 02:30:36PM +0100, Léa Gris wrote: > Should variables automatically created within arithmetic constructs have the > integer flag implied? No. Please, no. It's bad enough that the -i flag exists in the first place, without it being randomly added to poor innocent

Variables declared in arithmetic expressions have no i flag

2020-11-24 Thread Léa Gris
Should variables automatically created within arithmetic constructs have the integer flag implied? unset x; ((x = 42)); typeset -p x > declare -- x="42" Should it be: declare -i x="42" Here are cases where that would make a difference: unset x; ((x = 42)); x+=624; typeset -p x > declare

Re: increment & decrement error when variable is 0

2020-11-24 Thread Ilkka Virta
On Tue, Nov 24, 2020 at 12:07 AM Jetzer, Bill wrote: > ((--x)) || echo "err code $? on --x going > from $i to $x"; > > err code 1 on ++x going from -1 to 0 > That's not about --x, but of the ((...)) construct: "" (( expression )) The arithmetic expression is