复制代码执行 格式问题?

问题?

执行 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/xc2xa0//g' test.sh

再重新查看就没了 

# cat -v test.sh

再执行就好了 

原文地址:https://www.cnblogs.com/sharesdk/p/13140206.html