Linuxshell脚本在windows下编辑后执行出错
2013-11-14 15:18
85 查看
例子:将UTF-8转换为GBK编码输出
/bin/sed -n '1p' /home/server/log/IPMI-BMC-SERVER.log | iconv -f UTF8 -t GBK
一般会出现如下报错:
/bin/bash^M: bad interpreter: 没有那个文件或目录
解决办法:
sed -i 's/\r$//' filename
/bin/sed -n '1p' /home/server/log/IPMI-BMC-SERVER.log | iconv -f UTF8 -t GBK
一般会出现如下报错:
/bin/bash^M: bad interpreter: 没有那个文件或目录
解决办法:
sed -i 's/\r$//' filename
相关文章推荐
- Windows下记事本编辑的Shell脚本放到Linux下执行出错,格式问题(/bin/bash^M: bad interpreter: 没有那个文件或目录)
- windows下写的shell脚本在linux执行出错的解决办法
- windows下写的shell脚本在linux执行出错的解决办法
- windows下通过Runtime.getRuntime().exec.()执行linuxshell脚本
- windows下写的shell脚本在linux执行出错的解决办法
- linux执行windows编写的shell脚本出错
- windows下写的shell脚本在linux执行出错的解决办法
- 使用pycharm编辑自动化脚本,执行后没有html报告生成的几种解决办法
- mongodb脚本从windows上传到linux无法执行
- windows 2008AD计算机启动脚本无法执行
- 使用windows或Linux脚本执行Java项目-JSON例子(二)
- windows下写的脚本,在linux下执行失败
- 如何在windows bat脚本中调用Cygwin并执行命令?
- 如何修复:Windows上面的WScript的脚本(.vbs)不能执行了?
- windows上使用notepad++编辑shell脚本,并通过cygwin运行
- windows从shell中执行import MySQLdb正确,CGI程序中出错
- windows开机自动执行bat脚本启动cmd命令窗口并执行命令,最后自动关闭cmd命令窗
- 小虫软测(1)--使用windows的命令行输入cmd执行简单脚本
- windows写的脚本到linux里面就不能执行
- Windows下写shell脚本到Linux下执行遇到的问题及解决方案