3 ms·
$[...] also establishes an arithmetic context, so $[RANDOM % 10] works fine – but you're right, $[...] is not even mentioned in the manual any longer. The r
by bewuethr 7y ago
$[...] also establishes an arithmetic context, so
$[RANDOM % 10]
works fine – but you're right, $[...] is not even mentioned in the manual any longer. The release notes[1] say that it's "no longer supported" in the changes for Bash 2.0 (that's 1996!), and Chet Ramey talks about it in the bug-bash mailing list[2].
[1]: http://tiswww.case.edu/php/chet/bash/NEWS http://tiswww.case.edu/php/chet/bash/NEWS
[2]: https://lists.gnu.org/archive/html/bug-bash/2012-04/msg00034.html https://lists.gnu.org/archive/html/bug-bash/2012-04/msg00034...