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


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

Error on arithmetic evaluation of `~0`.

Started byBize Ma <binaryzebra@gmail.com>
First post2018-12-19 22:31 -0500
Last post2018-12-19 22:31 -0500
Articles 1 — 1 participant

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


Contents

  Error on arithmetic evaluation of `~0`. Bize Ma <binaryzebra@gmail.com> - 2018-12-19 22:31 -0500

#14931 — Error on arithmetic evaluation of `~0`.

FromBize Ma <binaryzebra@gmail.com>
Date2018-12-19 22:31 -0500
SubjectError on arithmetic evaluation of `~0`.
Message-ID<mailman.5985.1545276710.1284.bug-bash@gnu.org>
This is the third time I am reporting this issue.

This fails:

var=(hello); echo "${var[~0]}"
syntax error: operand expected ...

While this works:

var=(hello); echo "${var[ ~0]}"
hello

It is also interesting that this fails:

var=hello; echo "${var[ ~0]}"
bash: var: bad array subscript

Isn't `var[0]` valid and equivalent to `var` ?

This was "supposed" to be resolved in a dev version,
but is still present on bash 5.

[toc] | [standalone]


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


csiph-web