Index of /dee/software/ST/wordcount
Name Last modified Size Description
Parent Directory -
SHA256.txt 2022-09-25 15:57 80
README.html 2022-09-25 15:57 931
wordcount.m2.txt 2022-09-25 15:57 1.7K
alternatives.m2.txt 2022-09-25 15:57 7.3K
wordcount.exe 2022-09-25 15:57 118K 64-bit Windows binary
PROGRAM
wordcount: count words from the standard input
USAGE
wordcount [ -a | -l | -w | -c ]
DESCRIPTION
wordcount provides a count of the words, text lines, and single
byte characters from a text stream.
A word is a sequence of characters bounded by a new line, a blank,
or a horizontal tab.
Remember that the standard ASCII newline is two characters,
i.e. CRLF. On Unix, GNU/Linux, and Plan 9, there's a more robust
command: wc.
EXAMPLE
C:\Users\David> wordcount
hello, world
^Z
2
C:\Users\David> wordcount -a
hello, world
^Z
1 2 13
C:\Users\David> echo hello, world | wordcount -a
1 2 14
C:\Users\David> echo hello, world > hello.txt
C:\Users\David> <hello.txt wordcount -a
1 2 14
C:\Users\David> type hello.txt | wordcount -a
1 2 14
BUGS
The defintion of a word is simplistic.