Skip to content

Instantly share code, notes, and snippets.

@morsik
Created December 31, 2011 10:11
Show Gist options
  • Save morsik/1543597 to your computer and use it in GitHub Desktop.
Save morsik/1543597 to your computer and use it in GitHub Desktop.
Math Power function
#!/bin/bash
number=$1
power=$2
result=1
for (( i=1; i<=$power; i++ ))
do
result=$(( $result * $number ));
echo "$number ^ $i = $result"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment