bash script that counts string occurrence
Hi,
I have a file with names: Code:
John Code:
Mary - 3 1. sorted the file 2. removed duplicate lines using uniq and saved to a temp file 3. went through this file and used Code:
grep -c $LINE file_with_names It works but It seams to complicated for me. Is there a simplier solution? An one line command would be fine. |
Code:
… | sort | uniq -c |
Code:
[twantrd@twantrd tmp]$ cat names | sort | uniq -c |
Moin,
Code:
sort names | uniq -c Jan |
All times are GMT -5. The time now is 05:28 AM. |