aoc

Advent of Code Solutions
git clone git://git.alexkarle.com.com/aoc
Log | Files | Refs | README | LICENSE

sloc (359B) [raw]


      1 #!/bin/sh
      2 find 20* -type f -name '*.*' | \
      3   egrep '(go|py|scm|c|pl)$' | \
      4   xargs wc -l | \
      5   grep -v total | \
      6   awk '{ split($2, a, "."); s[a[2]] += $1 } END { for (k in s) { printf("%s\t%d\n", k, s[k]) }}' |\
      7   sort -n -k 2 -r |\
      8   sed -e 's/py/Python/' \
      9       -e 's/go/Golang/' \
     10       -e 's/pl/Perl/'   \
     11       -e 's/scm/Scheme/' \
     12       -e 's/c\>/C/'