Showing results for August 25, 2011 - The Old New Thing

Aug 25, 2011
Post comments count0
Post likes count0

Stupid command-line trick: Counting the number of lines in stdin

Raymond Chen
Raymond Chen

On unix, you can use to count the number of lines in stdin. Windows doesn't come with , but there's a sneaky way to count the number of lines anyway: It is a special quirk of the command that the null string is treated as never matching. The flag reverses the sense of the test, so now it matches everything. And the flag returns the count. ...

CodeTips/Support