Skip to content

Instantly share code, notes, and snippets.

@rich-97
Last active December 16, 2016 03:12
Show Gist options
  • Save rich-97/784344db4fed77f46550fa9e5f2a3e79 to your computer and use it in GitHub Desktop.
Save rich-97/784344db4fed77f46550fa9e5f2a3e79 to your computer and use it in GitHub Desktop.
Suseción Fibonacci con la Shell Bash.
# Fibo between 0 and 30.
len=30
arr=()
for (( i = 0; i < len; i++ )); do
if (( i > 0 )); then
let arr[i]="arr[i - 1] + arr[i - 2]"
else
let arr[i]=i
fi
echo ${arr[i]}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment