Question: 1) Write a Bourne Shell script called mySeq.sh (which simulates the GNU utility seq ) that prints a sequence of numbers, from FIRST to LAST,

1) Write a Bourne Shell script called "mySeq.sh" (which simulates the GNU utility seq) that prints a sequence of numbers, from FIRST to LAST, in steps of INCREMENT. If only LAST is given, it will print out a sequence of numbers from 1 to LAST in steps of 1. If both FIRST and LAST are given, it will print out a sequence of numbers from FIRST to LAST in steps of 1. If FIRST, INCREMENT and LAST are all given, it will print out a sequence of numbers from FIRST to LAST in steps of INCREMENT. Note: please do not use existing utility seq in your code.

Below is the sample output:

$./mySeq.sh 3

1 2 3

$./mySeq.sh 2 4

2 3 4

$./mySeq.sh 2 3 7

2 5

Hint: you may need to check the number of arguments by reading the value stored in $# .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!