Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Unix Problem 9 Create 1 shell scripts, . Put it in a new file, and name them script2.sh . Make sure to run the command
Unix
Problem 9 Create 1 shell scripts, . Put it in a new file, and name them script2.sh . Make sure to run the command chmod 777 script2.sh to give full permissions to read, write, and execute script
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 argument is given to your script which is the total number of 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 fi two numbers, then have your code calculate the rest automatically. Assume that a logical number wil always be given to you (don't 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
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