Project

General

Profile

« Previous | Next » 

Revision 959

error_stats: Simplified to use uniq --count option

View differences:

bin/error_stats
4 4

  
5 5
alias grep='grep --color=never'
6 6

  
7
errorsStr="$(grep -F '' "$@"|sort|uniq)"
8
splitErrors ()
9
{
10
    local IFS=$'\n'
11
    errors=($errorsStr)
12
}
13
splitErrors
14

  
15
for error in "${errors[@]}"; do
16
    count="$(grep -F "$error" "$@"|wc -l)"
17
    printf "%6d %s\n" "$count" "$error"
18
done
7
grep -F '' "$@"|sort|uniq --count

Also available in: Unified diff