How do I open the man page for square brackets math and what are they called?
I have been working with them for a while now (math equations in $[]
, not the arrays)
arrConflicts[0]=$[arrConflicts[0]+1]
currentCombination=$[ (arrFiles[0]-1+arrFiles[0]-i)*i/2-arrFiles[0]+j ]
How to call the man page?
What is this math called (to google)?
Does it have a min and max function?
Solution 1:
It's one way of doing arithmetic expansion in bash. It was deprecated years ago, and current GNU documentation doesn't mention it (Ubuntu's manpages still do, though: run man bash
and see the section on Arithmetic Expansion). From this Stack Overflow post:
The manpage for bash v3.2.48 says:
[...] The format for arithmetic expansion is:
$((expression))
The old format $[expression] is deprecated and will be removed in upcoming versions of bash.
You should use $((...))
instead.
No, it doesn't have min
or max
functions.