$ sed -e 's/[^A]//g' | wc -c
Thank you, I'll read up on sed.
grep(1) is line-oriented, so it's rather difficult to achieve what you want with grep.
$ sed -e 's/[^A]//g' | wc -c
Thank you, I'll read up on sed.
grep(1) is line-oriented, so it's rather difficult to achieve what you want with grep.