dos2unix,从本地传文件到linux时,执行报 $'\r': command not found,dos2unixlinux


从本地传文件到linux时,执行报 $'\r': command not found,

执行该文件时,报了$'\r': command not found,其实是因为本地ascll码,然而linux不识别,所以执行的时候报了该错误

只要利用dos2unix 命令转换一下格式即可

build_sandbox.sh: line 2: $'\r': command not found
Running
: octal number out of rangemask: 027
build_sandbox.sh: line 5: $'\r': command not found
build_sandbox.sh: line 10: $'\r': command not found
build_sandbox.sh: line 31: syntax error near unexpected token `$'{\r''
'uild_sandbox.sh: line 31: `function LOG() {
 

打开文件,发现没有错误中的字符,其实就是格式错误

dos2unix  filename

按照例子,就是执行一下dos2unix build_sandbox.sh,再重新执行文件,则不会再报错

相关内容

    暂无相关文章