It is working for me with the same file content. Are you sure that there isn't a newline or space at the end of one, but not the other? You should try two things to verify that all is well with your script on your system: 1) compare a file to itself and 2) compare a file to an actual copy of itself. However, I suspect there is some invisible character that is causing the problem. On the command line, try
.