Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

awk command in UNIX using a script. I need to produce a listing from a raw data

ID: 3594155 • Letter: A

Question

awk command in UNIX using a script.

I need to produce a listing from a raw data file which has a bunch of course numbers and 9 digit employee numbers at the end like the following two examples.

Fall 2017 COMM 438T-01 21785 888972491

Summer 2017 MSW 571-40 11230 890248716

I'm trying to produce a listing which is grouped by season (fall and summer) and ordered by class number(the numbers around the dash) and then section number(the 5 digit number) in descending order. Then a count for the amount of Fall and Summer groups. I have the awk command and scripting as tools to do this.

Explanation / Answer

awk -F ":" '{ print $1 " " $2 " " $3 " " $4 " " $5 " " $6 }' /etc/passwd | sort

This command will be helpful.