Counting characters with unix utilities

WU SHI-KUEI skwu at boulder.Colorado.EDU
Tue Sep 25 02:29:57 AEST 1990


The solution:

	cat file | tr -c 'A' '' | wc -c

is very close.  Just change it to:

	cat file | tr -cd 'A' | wc -c

and you'll count nothing but A's.



More information about the Comp.unix.shell mailing list