I would open both scripts with vi so you can see control codes, something is getting messed up, and make sure when you are typing it in at the command line that you are typing it, not copying and ...