将Shell脚本从windows环境复制到Linux环境运行报错

 

修改文件格式为unix
使用vi/vim进入文件,命令模式
输入::set ff=unix
或者::set fileformat=unix

wq保存退出

可以正常运行