Re: Variables declared in arithmetic expressions have no i flag

2020-11-26 Thread Chet Ramey
On 11/24/20 8:30 AM, Léa Gris wrote: > Should variables automatically created within arithmetic constructs have > the integer flag implied? No. There's no reason to do this. If you want an integer variable, declare it as such beforehand. -- ``The lyf so short, the craft so long to lerne.'' - Cha

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.

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 --