Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #wc #exclude #directories #empty #commented #lines
ADD COMMENT
Topic
Name
4+4 =