Another Unix gotcha occurs if you've been developing your script on a windows PC. On unix: vi myscriptname.iplYou may see loads of ^M characters at the end of each line. Type ":q" to quit vi and then both of the following: dos2unix myscriptname.ipl myscriptname.ipl chmod +x myscriptname.iplwill remove them for you.
:1,$s/^M//g
omygod... in order to fix ^M in vi one has to type just this: :1,$s/^M//g here ^M are entered as Ctrl-v Ctrl-M
:%s/^M//g
Or: :%s/^M//g '%' addresses the entire file - regardless of your current position - it's essentially the same as '1,$' but two characters shorter ;-)