Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14539 > unrolled thread

bash 5.0 nested array subscript arithmetic expansion error

Started byGrisha Levit <grishalevit@gmail.com>
First post2018-08-27 12:25 -0400
Last post2018-08-27 12:25 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug


Contents

  bash 5.0 nested array subscript arithmetic expansion error Grisha Levit <grishalevit@gmail.com> - 2018-08-27 12:25 -0400

#14539 — bash 5.0 nested array subscript arithmetic expansion error

FromGrisha Levit <grishalevit@gmail.com>
Date2018-08-27 12:25 -0400
Subjectbash 5.0 nested array subscript arithmetic expansion error
Message-ID<mailman.6.1535387145.1284.bug-bash@gnu.org>
This used to work:

bash-4.4$ a=0
bash-4.4$ echo $(( a[a[0]] ))
0
bash-4.4$ echo ${a[a[a[0]]]}
0

But is broken in bash-5.0:

bash-5.0$ a=0
bash-5.0$ echo ${a[a[a[0]]]}
bash: a[a[0]]: syntax error: invalid arithmetic operator (error token is "]")
bash-5.0$ echo $(( a[a[0]] ))
bash: a[a[0]] : syntax error: invalid arithmetic operator (error token is "] ")

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web