运行shell脚本提示找不到该文件的错误,解决办法【搬运】
有的时候运行shell脚本出错,一般是找不到该shell文件,大部分是因为该脚本是在windows下生成的再copy到linux下,用下面的命令检查一下:
$ head -1 yourscript | od -c
and see how it ends: This is wrong
0000000
# ! / b i n / b a s h \r \n
This is correct:
0000000
# ! / b i n / b a s h \n
Use dos2unix to fix your script if this is the issue.