/bin/sh^M: bad interpreter: No such file or directory

bash: ./get_perform: /bin/sh^M: bad interpreter: No such file or directory  

2012-04-11 17:50:53|  分类: NS2|举报|字号 订阅

http://hi.baidu.com/252568175/blog/item/b97a5f225102d9a84623e8a6.html

 http://hi.baidu.com/sallenbring/blog/item/08a35113edaeab75cb80c479.html

        在NS2中,编写shell脚本自动完成工作时,由于get_perform是在windows下编写的,在每行后面会加个ctrl+m就是^M(^和字母M, 它是一个字符, 其ASCII是0x0D, 生成它的办法是先按CTRL+V, 然后再回车(或CTRL+M)),所以后面的,sh就变成sh^M当然是没有这个命令的,所以脚本就不能运行了,把^M去掉就应该没问题了。
dos2unix configure 

我用的是ubuntu,在没有安装dos2unix时,采用命令sudo apt-get install dos2unix,即可,然后运行dos2unix configure ,即完成了格式的转变。

dos2unix: converting file configure to UNIX format

(1)有很多种办法看这个文件是DOS格式的还是UNIX格式的, 还是MAC格式的

 vi filename


如果没有此命令
cat ./configure.sh | tr -d '\r' > temp.sh
mv temp.sh configure.sh
[hyan1@localhost vtcl-1.6.1a1]$ dos2unix configure
dos2unix: converting file configure to UNIX format ...
[hyan1@localhost vtcl-1.6.1a1]$ ls
ChangeLog  configure  demo  doc  freewrap  images  lib  LICENSE  README  sample  vtclmac  vtcl.tcl
[hyan1@localhost vtcl-1.6.1a1]$ ./configure
Using /usr/bin/wish8.4
[hyan1@localhost vtcl-1.6.1a1]$


http://blog.163.com/cumtwjr19890217@126/blog/static/109813925201231154958613/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值