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


Groups > gnu.bash.bug > #14539

bash 5.0 nested array subscript arithmetic expansion error

From Grisha Levit <grishalevit@gmail.com>
Newsgroups gnu.bash.bug
Subject bash 5.0 nested array subscript arithmetic expansion error
Date 2018-08-27 12:25 -0400
Message-ID <mailman.6.1535387145.1284.bug-bash@gnu.org> (permalink)

Show all headers | View raw


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 "] ")

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web