[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error on arithmetic evaluation of `~0`.

From: Bize Ma
Subject: Error on arithmetic evaluation of `~0`.
Date: Wed, 19 Dec 2018 22:31:36 -0500

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

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]