I have this code that counts the occurrences of different college majors within the file:
#!/bin/bash
file=$1
OUT=$( cat $file | cut -d',' -f3 | sort | uniq -c)
echo $OUT
That produces this output:
4 Computer Information Systems 2 Computer Science 2 History 1 Marketing 2 Social Studies
How do I get the output to look like this:
4 Computer Information Systems
2 Computer Science
2 History
1 Marketing
2 Social Studies
With every major being on its own line?
This may seem like a silly question but I am very new to bash scripting. TIA for any help!