Question: 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:

Please use Linux to write the following question: Write a shell script

that only prints the odd numbered lines of each file in the

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

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!