Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ]
  1. How to call the man page?

  2. What is this math called (to google)?

  3. Does it have a min and max function?

share|improve this question
up vote 14 down vote accepted

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.

share|improve this answer
    
Wow, I had no idea $[] was a thing. I expected from the title that the answer was going to be man '['. (i.e. test) – Peter Cordes Jan 29 at 15:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.