I use the following command to count lines of code (skipping blank lines and comments) in python scripts:
sed '/^\s*#/d;/^\s*$/d' *.py | wc -l
This works just fine, and I am trying to turn this into an alias.
Seems that I am not escaping some characters properly, because this:
alias loc="sed '/^\s*#/d;/^\s*$/d' \$1 | wc -l"
does not work.