Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part I Use commands grep, cut, head and tail to write a bash script called selector. It accepts one file and two words as arguments

Part I
Use commands grep, cut, head and tail to write a bash script called selector. It accepts one file and two words as arguments and prints out the portion of the given file between the line of the first appearance of the first word (this line included) and the line of the first appearance of the second word (this line included).
You can assume that the first occurrence of the first word always appears earlier than the first occurrence of the second word.
Part II
Modify selector to write selector 2. It prints out the portion between the line of the second appearance of the first word and the line of the second appearance of the second word.
Use bash if-statement and test expression to check if the second appearance of the first word appears after the second appearance of the second word. If so, inform the user about this.
Sample run:
image text in transcribed

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

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions

Question

b. Explain how you initially felt about the communication.

Answered: 1 week ago