Skip to content

Instantly share code, notes, and snippets.

@lazyakshay
Created April 8, 2017 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save lazyakshay/412bfa813ec6291afda130381d7cadc5 to your computer and use it in GitHub Desktop.
Save lazyakshay/412bfa813ec6291afda130381d7cadc5 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