Answers for "wc exclude . and .. directories and empty or commented lines"

0

wc exclude . and .. directories and empty or commented lines

# Although, that's language dependent... Examples can be found below...
cat foo.c | sed '/^\s*$/d' | wc -l

And if you consider comments blank lines:
cat foo.pl | sed '/^\s*#/d;/^\s*$/d' | wc -l
Posted by: Guest on April-06-2022

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language