-bash: ./job.sh: /bin/sh^M: bad interpreter: 没有那个文件或目录

    昨天在windows下用写字板写了个shell脚本,使用winscp上传到linux上运行的时候发现运行不了,提示-bash: ./job.sh: /bin/sh^M: bad interpreter: 没有那个文件或目录,经过查找资料发现原因如下:

   1、dos格式的文本文件要转换为unix格式的文本文件,在linux上操作如下:#unix2dos job.sh

   2、或者vi job.sh

     set ff=unix

    wq!

保存退出后就可以运行。

原文地址:https://www.cnblogs.com/networking/p/4021400.html