复制代码执行 格式问题?

问题?

执行 shell 错误

错误
syntax error near unexpected token `}'

查看字符编码格式

# cat -v test.sh

空格部分 显示的都是 一些

...
M-BM- M-BM-
M-BM- M-BM-
M-BM- M-BM-
...

更改替换为十六进制格式 

# sed -i 's/\xc2\xa0//g' test.sh

再重新查看就没了 

# cat -v test.sh

再执行就好了 

shell  服务文件错误

报错:/bin/bash^M: bad interpreter: No such file or directory

vim 编辑器进去  执行 :set ff=unix

 

posted @ 2020-06-16 11:56  01234567  阅读(211)  评论(0编辑  收藏  举报