标签 编码 下的文章

syntax error near unexpected token `fi'

执行脚本反馈错误syntax error near unexpected token `fi' 原因:在windows下写的脚本放到linux下可能造成编码问题,可以执行 cat -v xxx.sh,发现换行后面多出了^M解决办法: vi xxx.sh执行::set ff 显示:fileformat=unix 执行::set ff=unix 保存退出::wq

标签: linux, 编码