I've started having a problem lately - every time I write a sh file it ends up having the wrong line endings after I upload it to my Linux box via FTP so I get this when I try and run it:
when I change the file mode to unix in vim it runs fine, and when I copy the file back across FTP and right back it works fine, until I edit it in Brackets or Sublime Text, then it somehow gets the carrage return back in the file. Wtf? I haven't changed anything in my setup anywhere and I haven't changed programs/ftp settings/etc.
Code:
x@x ~/xxx $ ./update_rrd_db.sh
-bash: ./update_rrd_db.sh: /bin/bash^M: bad interpreter: No such file or directory
when I change the file mode to unix in vim it runs fine, and when I copy the file back across FTP and right back it works fine, until I edit it in Brackets or Sublime Text, then it somehow gets the carrage return back in the file. Wtf? I haven't changed anything in my setup anywhere and I haven't changed programs/ftp settings/etc.