New answers tagged wc
All you need is sort macadd | uniq -c as explained by @roaima but I just wanted to point out how you could do it using the same approach you had attempted. There's no reason to grep through the file, you can just feed it directly to while: while read mac; do echo "$mac"; done < macadd Also, grep has a -c option which counts matches. So, with a couple ...
Try this sort macadd | uniq -c
Top 50 recent answers are included