Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions