Write a shell script that will generate first n Fibonacci numbers like: 1, 1, 2, 3, 5, 13,…

 

 


Write a shell script that will generate first n Fibonacci 

                numbers like: 1, 1, 2, 3, 5, 13,…




Program =



#!/bin/bash

echo "Utsav Gohel 91900104011"

echo "Enter lower limit = "

read n

a=0;

b=1;

c=2;

echo "Fibonacci Series up to $n lower limit :"

echo "$a"

echo "$b"

while [ $c -lt $n ]

do

c=`expr $c + 1 `

total=`expr $a + $b `

 

echo "$total"

a=$b

b=$c

done

 

Output =