Files
riivaaja/spawn-status.sh
T
2019-08-30 09:03:33 +02:00

10 lines
471 B
Bash
Executable File

#!/bin/sh
set -e
diff /root/spawn-orig_full.asm compare_full.asm > /tmp/asm.diff || true
insertions=$(cat /tmp/asm.diff | grep -v "asm" | grep "^+" | grep -vc ';')
deletions=$(cat /tmp/asm.diff | grep -v "asm" | grep "^-" | grep -vc ';')
total=$(grep -v ^$ /root/orig_full.asm | grep -vc ';')
accuracy="$(((insertions + deletions) / (total * 2 / 100)))% change, $((insertions)) insertions(+), $((deletions)) deletions(-)"
echo "$accuracy" > accuracy.txt
echo "$accuracy"