memory-leaks

Still reachable: lots of words in many pages.
git clone https://git.kevinlegouguec.net/memory-leaks
Log | Files | Refs | README | LICENSE

update-count.sh (482B)


      1 #!/bin/bash
      2 
      3 list-tracked ()
      4 {
      5     GIT_LITERAL_PATHSPECS='' git ls-files '*.md' '*.org'
      6 }
      7 
      8 count-leaks ()
      9 {
     10     let pages=0
     11     let words=0
     12 
     13     while read filename
     14     do
     15         let words+=$(git show HEAD:${filename} | wc -w | cut -d' ' -f1)
     16         let pages+=1
     17     done
     18 
     19     echo ${words} ${pages}
     20 }
     21 
     22 
     23 
     24 read words pages < <(list-tracked | count-leaks)
     25 
     26 pattern="[0-9]* words in [0-9]* pages"
     27 actual="${words} words in ${pages} pages"
     28 
     29 sed -i "s/${pattern}/${actual}/" README.md