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/