title: Compound interest in bash scripting
body: <p>I am trying to write a script that takes a given amount (a) and uses a set interest rate of 10% annually to find out how long it would take to accumulate 1,000,000. The problem is that all the examples I can find only show examples for simple interest as below.</p>
  
  <pre><code>echo " Enter the principle value: "
  read p
  echo " Enter the rate of interest:"
  read r
  echo " Enter the time period:"
  read t
  s=`expr $p \* $t \* $r / 100`
  echo " The simple interest is "
  echo $s
  </code></pre>
  
  <p>The problem is I need it for compound interest. I was thinking the answer might be in a while loop with a counter that added up how man times the loop ran with the fixed amount of money and interest until million is hit and then echoed the number of loops. My problem (being math challenged) is I don't know what that formula would look like and I can't find any examples of it on the net in bash.</p>