Skip to content

Instantly share code, notes, and snippets.

@DevOps-Emre
Forked from lazyakshay/ fibonacci.sh
Created August 31, 2021 20:58
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 DevOps-Emre/9fb3d5e923111672b6219b0bc6e0e6b2 to your computer and use it in GitHub Desktop.
Save DevOps-Emre/9fb3d5e923111672b6219b0bc6e0e6b2 to your computer and use it in GitHub Desktop.
shell script to generate fibonacci series
#!/bin/bash
c=2
a=1
b=1
d=0
echo "enter the number of elements"
read n
echo "$a"
echo "$b"
while((c<n))
do
d=$((a+b))
echo "$d"
a=$b
b=$d
c=$((c+1))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment