Xref: utzoo comp.unix.questions:25713 comp.unix.shell:280 Path: utzoo!attcan!uunet!mailrus!ncar!boulder!skwu From: skwu@boulder.Colorado.EDU (WU SHI-KUEI) Newsgroups: comp.unix.questions,comp.unix.shell Subject: Re: Counting characters with unix utilities Message-ID: <26805@boulder.Colorado.EDU> Date: 24 Sep 90 16:29:57 GMT References: <4002@umbc3.UMBC.EDU> Sender: news@boulder.Colorado.EDU Reply-To: skwu@spot.Colorado.EDU (WU SHI-KUEI) Organization: University of Colorado, Boulder Lines: 9 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.