有的时候运行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.
如果出现上述问题,直接运行下面命令即可:dos2unix filename
联系客服