![]() |
Help for bash script
Hi,
I've a very long text file with this kind of content: Quote:
My goal is to obtain a "count" for every code. For example, if "aaaaaaaaa" appears 576 time, "bbbbbbbbb" 78, "ccccccccc" 921 and so on: Quote:
Thankyou! |
Code:
man uniq |
Try this:
Code:
for i in `cat test.txt | sort -u`; do Hope this helps. :) |
If you use Bash 4.0+, it's actually just simple:
Code:
#!/bin/bashCode:
# bash script.sh < input_file |
Code:
sort yourfile | uniq -c |
| All times are GMT -5. The time now is 05:13 PM. |