Question: Need it for Shell scripting: UNIX I have a text file astronauts.txt. I need to extract the second word of each line from this text

Need it for Shell scripting: UNIX

  1. I have a text file astronauts.txt. I need to extract the second word of each line from this text file, astronauts.txt. and save it in a new file called members.txt. How can I do this using a (i) for loop and (ii) command cut?
  2. I have created a directory that has 5 files.

Name of the Directory: Space

Name of File 1 : Astronautone

Name of File 2: Astronauttwo

Name of File 3: Astronautthree

Name of File 4: Astronautfour

Name of File 5: Astronautfive

I want to create a new file named Astronautsummary which will be having the 10th line of each file saved in the directory Space using for loop.

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!