Hello, I am taking an introductory to Unix class. I have received an assignment
ID: 3602148 • Letter: H
Question
Hello, I am taking an introductory to Unix class. I have received an assignment in which we are supposed to create a menu that sorts and categorizes a list of wine based on the different types. I am including an image of the assignment along with the txt file we are supposed to include within the script.
The file below this drop, wine.txt, contains the records from a wine data file. The 5 fields in each row are: The wine identification number ·Wine name Type of wine (2-Sparkling, 3-Fortified, 4-Sweet, 5-White, 6-Red) Year wine was made · Winery Number This assignment requires that you create a report that will print the number of wines by type. The report should have a proper heading that includes a main heading e The main heading should include the current date The report heading should also have column headings for the type of wine and total (for the total of each type of wine) The record output should be formatted to display the data (wine type and count) below each column header The report should print on a "clean screen"Explanation / Answer
clear
dt=$(date)
echo -e "Number of wines bt type " $dt
echo -e "Type of wine " "Count"
cut -d: -f 3 wine.txt > temp.txt
awk '{count[$1]++}END{for(j in count) print j,count[j]}' temp.txt
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.