Last active
December 30, 2015 11:09
-
-
Save manuzhang/7820641 to your computer and use it in GitHub Desktop.
calculate insertions and deletions from diff files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh - | |
# calculate insertions | |
cat $1 | grep "^[+][^+].*" | egrep -v "(^[+][[:space:]]*[/]|^[+][[:space]]*[*])" | wc -l | |
# calculate deletions | |
cat $1 | grep "^[-][^-].*" | egrep -v "(^[-][[:space:]]*[/]|^[-][[:space]]*[*])" | wc -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment