What are you trying to achieve?
If all you want to do is count how many lines are in a file, you might want to look at the
wc program.
If you want to be able to count specific characters, you might want to look at the
grep command (take a look at the '--count' option).