ниже мой входной файл, результаты продолжают возвращать "Breed has Votes voices"
Breed, Votes
Black Lab, 30
Chihuahua, 2
Pug, 1
Corgi, 45
Shar Pei, 21
Shih Tzu, 5
Maltese, 7
#!/bin/sh/awk
##comment The below awk script runs on the file dog_breed.txt, FS refers to field separator which is a comma in this case. We initialize our max variable to 0 and max_breed to the first breed, then iterate over the rows to find the max voted breed.
BEGIN{
FS=", "
max=0;
max_breed=$1
}
{
if(max<($2)){
max=$2;
max_breed=$1;
}
}
END{
print max_breed " has " max " votes"
}