Thanks everyone for your help -- I finally got this to work. After Jerry sent me his script which worked and I ran the od -c command on it, I discovered that my emacs is putting \r\n at each newline and his script only has \n. Taking out the \r works. Now I just need to figure out how to keybind a plain old \n to my enter key and I'm all set...