shell脚本提示$‘\r‘: command not found
linux运行shell脚本,提示:line 1: $'\r': command not found原因:Shell脚本在Windows系统编写时,每行结尾是\r\n,而在Linux系统中行每行结尾是\n,在Linux系统中运行脚本时,会认为\r是一个字符,导致运行错误。解决办法:在shell脚本所在目录执行语句:sed -i 's/\r//' test.shtest.sh:为脚本名称...
原创
2022-05-20 15:07:28 ·
1814 阅读 ·
0 评论