Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use Linux to write the following question: Write a shell script that only prints the odd numbered lines of each file in the current

Please use Linux to write the following question:

Write a shell script that only prints the odd numbered lines of each file in the current directory, except for the script itself. The output should be filename: line for each odd numbered line. You do not need to print line numbers.

Write the script in a way that it works no matter the filename given to the script.

For example, lets say I write a script in a file called test.sh. I then create 3 files(file1,file2,file3), as shown in the screenshot below:

image text in transcribed

image text in transcribed

mininetOmininet-um/testS cat file1 line 1 line 2 line 3 line 4 line 5 mininetCmininet-um:test$ cat file2 line 1 line 2 line 3 line 4 line 5 mininetCmininet-um:/test cat file3 line 1 line Z line 3 line 4 line 5

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

Database Systems Design Implementation And Management

Authors: Carlos Coronel, Steven Morris

14th Edition

978-0357673034

More Books

Students also viewed these Databases questions

Question

69 Needs assessment and analysis.

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago