$‘\r’: command not found shell脚本执行报错 在windows上用txt写的shell脚本放到服务器上执行报错$'\r': command not found 解决方法:vim/vi编辑脚本文件,设置文件格式为unix vim xxx.sh :set ff=unix :wq ff是fileformat的缩写 ps: 如果想设置为windows格式,则:set ff=dos 设置完成后执行脚本就没有这种报错了