I don't know if your script consists of using the unix command ls but as already said, only ls -a gives you
. and ..
But you could compose a regex to only count alphas and numbers possibly.
Es gibt mehr im Leben als Bücher, weißt du. Aber nicht viel mehr. - (Die Smiths)"