Skip to content

Instantly share code, notes, and snippets.

@doorknob60
Created September 5, 2012 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doorknob60/3630079 to your computer and use it in GitHub Desktop.
Save doorknob60/3630079 to your computer and use it in GitHub Desktop.
#!/bin/bash
declare -i a=47
declare -i n=25
declare -i z=0
while (($n>0)); do
z=$a+$z
n=$n-1
done
echo "The answer is $z"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment