You have to write a program that will count all the characters in specified source file so that people entering a code golf competition can see their score. You do not need to ignore comments (it is code golf) in your program but newlines should be counted as a character. The number of characters must be printed to stdout. Shortest code wins!
Example in python:
import sys try: content = open(sys.argv, "r").read() except IndexError, e: print("No file specified") sys.exit(1) except IOError, e: print("File not found") sys.exit(1) count = 0 for i in list(content): if(i!=''): count+=1 print(str(count)+" characters long")
Note: you cannot use the bash command