Question
b) script2.sh : Write a shell script that prints out the numbers of the Fibonacci series. This series of numbers is one where every number
b) script2.sh : Write a shell script that prints out the numbers of the Fibonacci series. This series of numbers is one where every number is the sum of the previous two numbers before it. For example, the first 10 number of the series is {0, 1, 1, 2, 3, 5, 8, 13, 21, 34}. The series is infinite, so assume that one command line argument is given to your script which is the total number of Fibonacci numbers to display. If a 1 is given, have it print off just the first number. If a 2 is given, have it just print off the first two numbers. If a 3 or bigger is given, have it print off the first two numbers, then have your code calculate the rest automatically. Assume that a logical number will always be given to you (dont worry about checking to see if the number is bigger than 0, for example). As an example, if you run your script using the command ./script2.sh 5 , your script should display to the screen the following:
0
1
1
2
3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started