view lib/karma @ 12253:ad5c5d1b7d04 draft

<oerjan> t sled lib/karma//s/egrep.*>/egrep -x \'<[^>]*>/
author HackEso <hackeso@esolangs.org>
date Fri, 06 Dec 2019 07:53:22 +0000
parents e037173e0012
children 616be78bd12e
line wrap: on
line source

#!/bin/sh
count () {
    hg log --template '{desc}\n' |
    egrep -x '<[^>]*> karma\'$1 |
    fgrep -vix "<$2> karma$1 $2" |
    cut -d' ' -f3 |
    fgrep -cix "$2"
}
plus=$(count + "$1")
minus=$(count - "$1")
echo $(($plus-$minus))