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 ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results