Write a shell script named sales1
using nawk
and sort
commands to do the following:
1. print the file in two sections, east and west, with lines alphabetized by last name
within each section, showing per quarter and total sales per person.
2. print the names of sales people in three groups:
"The following people had total sales greater than $270:"
"The following people had total sales between $250 and $270:"
"The following people had total sales less than $250:"
east:Sam Smith:52:72:78:62
east:Daniel Liebelt:83:78:84:61
east:Shirley Couts:66:57:67:37
east:James Peringer:50:62:56:94
east:Lilly Batsuro:58:85:84:52
west:Alex Opitz:79:68:57:93
west:Carmen Gondar:62:58:85:56
west:Derek Willard:63:69:74:43
west:Kim Husak:89:91:63:64
west:Lenny Taufa:53:61:82:52
I only need assistance with # 1...
I've tried
sort -k1,1 -k2,2
But it only sorts it by east then west and not by the last name. I'm trying to treat the first column as the direction and first name and the second column as the last name with the numbers...