Skip to content

Instantly share code, notes, and snippets.

@felixangell
Created October 7, 2016 21:03
Show Gist options
  • Save felixangell/621f47bb6546f26299ca1160ae34da36 to your computer and use it in GitHub Desktop.
Save felixangell/621f47bb6546f26299ca1160ae34da36 to your computer and use it in GitHub Desktop.
Simple line count shell script.
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Expected file extension to line count"
exit 1
fi
echo "There are $(git ls-files | grep ".$1" | xargs cat | wc -l) lines of $1 code."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment