title: Calculating a to power b (a^b) in shell script
body: <p>I am new to shell scripting. 
  I was doing some math problem in shell script, i found almost all the calculations involving math except a to power b (a^b). </p>
  
  <p>can anyone please tell me what am i doing wrong here?</p>
  
  <pre><code>echo -n "enter op1 opr op2: "
  read op1 opr op2
  
  power()
  {
      value = $op2
      a = $op1
      if [ $value -eq o ]
      then 
          echo "$op1 ^ $op2 = 1"
      else
          while [ $value -ne 1 ]
          do 
          a = expr $a \* $op1
          value =`expr $value - 1`
          done
          echo "$op1 ^ $op2 = $a"
      fi  
  }
  
  while [ "$op1" != "quit" ]
  do
      if [ $opr == "+" ]
      then
          echo "  result: $op1 + $op2 = "`expr $op1 + $op2` 
      elif [ $opr == "-" ]
      then
          echo "  result: $op1 - $op2 = "`expr $op1 - $op2` 
      elif [ $opr == "/" ]
      then
              echo "  result: $op1 / $op2 = "`expr $op1 / $op2` 
      elif [ $opr == "x" ]
      then
          echo "  result: $op1 x $op2 = "`expr $op1 \* $op2`
      elif [ $opr == "^" ]
          then
          echo "  result: $op1 ^ $op2 = "`expr $op1 ^ $op2`
          else
          echo "  invalid operator ( + - x / )"
  fi
  
  echo -n "enter op1 opr op2: "
  read op1 opr op2
  done
  </code></pre>