view lib/karma @ 12467:a4835ba01fb1 draft

<int-e> learn The password of the month was delayed by snow and ice and Elon Musk.
author HackEso <hackeso@esolangs.org>
date Sun, 20 Nov 2022 20:26:27 +0000
parents 9b8fbae1571a
children
line wrap: on
line source

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