I am attempting to count the occurrences of a particular string "PhD" within a file 'X', take that count# (e.g. 3), and print/cat to the beginning of another file, 3 times, this particular string
Graduate StudentID 1
Graduate StudentID 2
Graduate StudentID 3
The numbers after StudentID reflect the counting.
My hopeless attempt to this point is ($OUT was supposed to the file written to) and I am not sure how to resolve the (obvious) resultant errors.
find /home/college/Applications/Graduate -name "*.inp" -exec sed 's/[PhD]//g' input | uniq -c print >$OUT {$1} \;