Counting characters with unix utilities

Bob McGowen x4312 dept208 bob at wyse.wyse.com
Tue Sep 25 12:00:13 AEST 1990


In article <EMV.90Sep24165437 at picasso.math.lsa.umich.edu> emv at math.lsa.umich.edu (Edward Vielmetti) writes:
>In article <TED.90Sep24090053 at kythera.nmsu.edu> ted at nmsu.edu (Ted Dunning) writes:
>
>      cat file | tr -cd 'A' | wc -c
>
>   ed must have been kidding when he left the cat in place, instead of
....
>
>nope.  I cat files all the time.  That way when I go back to edit this command
>to work on the output of a command instead of the contents of a file
...

Also, a script using:

	cat $* | tr -cd 'A' | wc -c

can use command line args OR read its standard input.

Bob McGowan  (standard disclaimer, these are my own ...)
Product Support, Wyse Technology, San Jose, CA
..!uunet!wyse!bob
bob at wyse.com



More information about the Comp.unix.questions mailing list