Question: Linux command-line Create a file named XXAuthors (replace XX with the first 2 letters of your name.) and populate the file with the following data:
Linux command-line
- Create a file named XXAuthors (replace XX with the first 2 letters of your name.) and populate the file with the following data:
1111#Sanjida Nasreen#Toronto, Canada
2122#Munira Shirin#Ottawa, Canada
5155#John Hopkins#London, England
5166#Viki Samuels#Rome, Italy
5266#Aroz Ali#Dhaka, Bangladesh
5277#Sultana Kamal#Dhaka, Bangladesh
5288#Sufia Begum#Calcutta, India
6266#William Barnhurst#New York, USA
7466#Marco Boni#Paris, France
8122#Sujit Saha#Montreal, Canada
[Screen Shot #1: Display the contents of the file XXAuthors.]
- Create a file named XXPublications (replace XX with the first 2 letters of your name.) and populate the file with the following data:
C1123#Seven Wonders#1111
C1125#For You Only#2122
E1133#The Snows of London#5155
I1223#The Roman Empire#5166
B1250#The Golden Bengal#5266
B1350#The Moghul Period#5277
I1250#The Heritage#5288
U1234#The New President#6266
U2345#The Fate#9010
[Screen Shot #2: Display the contents of the file XXPublications.]
- Create a report named XXbrep (replace XX by your name.) by joining the files XXAuthors and XXPublications that will output the second field of the XXAuthors file followed by the second field of the XXPublications. The report should take care of the unpairable lines. In this case, a line should be printed for each author record that does not match a publication record and in which case, it will display a message for the unmatched record as: No Books.
[Screen Shot #3: Display the complete join command that will accomplish this task.]
- Display the full contents of the XXbrep file you just created.
The output for paired lines should look like:
Sanjida Nasreen#Seven Wonders
The output for unpairable lines should look like:
Marco Boni#No Books
(The file should contain 10 lines.)
[Screen Shot #4: Display the contents of the brep file.]
- Use awk utility to create a refined report named XXbrrep (replace XX by your name.) from the brep file that will eliminate the file delimeters (# in this case). Make sure that the report is properly formatted so that it maintains vertical alignment for its second column.
The output should look like:
Sanjida Nasreen Seven Wonders
(Other lines will follow)
Marco Boni No Books
(Other unpairable line will follow)
(The file should contain 10 lines.)
[Screen Shot #5: Display the awk command that will accomplish the task. Display the contents of the XXbrrep file.]
- Create a file name XXStudents (replace XX by your name.) with the following data:
Sanjida Nasreen#Local#Technician#6500
Munira Shirin#International#Technology#8500
John Hopkins#Local#Sofware#5000
Viki Samuels#International#Network#7000
Aroz Ali#Local#Technician#5200
Sultana Kamal#International#Network#9000
Sufia Begum#Local#Software#3000
William Barnhurst#Local#Technology#2500
Marco Boni#International#Technician#7800
Sujit Saha#Local#Technology#3000
[Screen Shot #6: Display the contents of the XXStudents file.]
- Use awk utility to print every line of the file XXStudents. Use the default behavior of awk print.
[Screen Shot #7: Show the command that accomplishes this task with output.]
- Use awk utility to print all records of the international students listed in the XXStudents file and store the output in a file named XXIntSt (replace XX by your name.)
[Screen Shot #8: Show the command that accomplishes this task.Display the contents of the XXIntSt file.]
- Use awk utility to print 5th, 6th, and 7thlines from the XXStudents file an.
[Screen Shot #9: Show the command that accomplishes this task with output.]
- Use awk utility to print the name and tuition fees (i.e., the first and the fourth fields.) only for the records that matches less than 5000.
[Screen Shot #10: Show the command that accomplishes this task with output.]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
