diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2018-06-07 18:18:19 +0200 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2018-06-07 18:18:19 +0200 |
| commit | bc858629703748e4ace70c9dd08128e55148f970 (patch) | |
| tree | bccd9746796931be50b3f89dbbcaf76697cc7e03 /update-count.sh | |
| parent | f8d44302df32dfb23261cf969e3d88e6f1db68d6 (diff) | |
| download | memory-leaks-bc858629703748e4ace70c9dd08128e55148f970.tar.xz | |
Tweak word-counting script
- make it more accurate by looking at files as they have been
committed (I often leave stuff out of commits)
- remove extraneous (I hope) parentheses
Diffstat (limited to 'update-count.sh')
| -rwxr-xr-x | update-count.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/update-count.sh b/update-count.sh index 8ada899..f592bcb 100755 --- a/update-count.sh +++ b/update-count.sh @@ -12,7 +12,7 @@ count-leaks () while read filename do - let words+=$(wc -w ${filename} | cut -d' ' -f1) + let words+=$(git show HEAD:${filename} | wc -w | cut -d' ' -f1) let pages+=1 done @@ -23,7 +23,7 @@ count-leaks () read words pages < <(list-tracked | count-leaks) -pattern="\([0-9]*\) words in \([0-9]*\) pages" +pattern="[0-9]* words in [0-9]* pages" actual="${words} words in ${pages} pages" sed -i "s/${pattern}/${actual}/" README.md |
