Practice 1
The given shell program will produce the fibonacci series that are represent like 0,1,1,2,3,5,8,13,......
# vi whilefib
n1=0
n2=1
echo $n1
while [ $n2 -lt 200 ]
do
echo $n2
n2='expr $n2 + $n2 '
n1='expr $n2 - $n1'
done
# sh whilefib
0
1
1
2
3
5
8
13
21
The given program uses the while statement to produce the fibonacci series.