linux中没有dos2UNIX或者UNIX2dos命令怎么解决办法
来源:互联网 发布:js 箭头函数作用域 编辑:程序博客网 时间:2024/06/05 03:50
背景:用cygwin运行shell命令发现符号会报错,查了发现没有多余的字符。
原因:linux中回车换行是两个字符,windows中是一个字符。
解决办法:在notepad++上代开code,点击视图-显示所有字符,会看到回车确实是两个字符,点击编辑,将字符转换成unix格式即可。
下面是查找到的解决办法。
[root@localhost ~]#dos2unix tr.py
-bash: dos2unix: command not found
安装方法:
在http://linux.softpedia.com/progDownload/Dos2Unix-Download-5519.html下载hd2u-1.0.0.tgz
[root@localhost ~]#tar -zxf hd2u-1.0.0.tgz
[root@localhost ~]#cd hd2u-1.0.0
[root@localhost ~]#./configure
- Configuring hd2u 1.0.0
- checking for gcc... gcc
- checking for C compiler default output file name... a.out
- checking whether the C compiler works... yes
- checking whether we are cross compiling... no
- checking for suffix of executables...
- checking for suffix of object files... o
- checking whether we are using the GNU C compiler... yes
- checking whether gcc accepts -g... yes
- checking for gcc option to accept ANSI C... none needed
- checking for a BSD-compatible install... /usr/bin/install -c
- checking for getopt_long in -lpopt... no
- configure: error: *** libpopt not found
- Configuring hd2u 1.0.0
- checking for gcc... gcc
- checking for C compiler default output file name... a.out
- checking whether the C compiler works... yes
- checking whether we are cross compiling... no
- checking for suffix of executables...
- checking for suffix of object files... o
- checking whether we are using the GNU C compiler... yes
- checking whether gcc accepts -g... yes
- checking for gcc option to accept ANSI C... none needed
- checking for a BSD-compatible install... /usr/bin/install -c
- checking for getopt_long in -lpopt... no
- configure: error: *** libpopt not found
在http://rpm.pbone.net/index.php3/stat/4/idpl/17960519/dir/other/com/popt-1.14-2rt.x86_64.rpm.html下载popt-1.14-2rt.x86_64.rpm
[root@localhost ~]#rpm -ivh popt-1.14-2rt.x86_64.rpm
[root@localhost ~]#cd hd2u-1.0.0
[root@localhost ~]#./configure&&make&&make install
[root@localhost ~]#whereis dos2unix
dos2unix: /usr/local/bin/dos2unix
安装成功
- linux中没有dos2UNIX或者UNIX2dos命令怎么解决办法
- linux中没有dos2UNIX或者UNIX2dos命令怎么解决办法
- linux中没有dos2UNIX或者UNIX2dos命令怎么解决办法
- linux中没有dos2UNIX或者UNIX2dos命令怎么解决
- Linux命令学习总结:dos2unix - unix2dos
- linux dos2unix 和 unix2dos
- linux编码格式与(dos2unix+unix2dos+file)等命令
- dos2unix和unix2dos命令使用
- dos2unix和unix2dos命令使用
- dos2unix和unix2dos命令使用
- dos2unix和unix2dos命令使用
- dos2unix和unix2dos命令使用
- dos2unix和unix2dos命令使用
- Linux之dos2unix和unix2dos
- dos2unix + unix2dos
- dos2unix, unix2dos
- dos2unix, unix2dos
- 解决执行dos2unix 和unix2dos命令
- IOS中Json解析的四种方法
- leetCode 106.Construct Binary Tree from Inorder and Postorder Traversal (根据中序遍历和后序遍历构造二叉树)
- S5PV210裸板驱动:启动
- 【暑假集训】之被ACM金牌大神虐的第二天之图论篇
- 两个Integer值比较不相等问题
- linux中没有dos2UNIX或者UNIX2dos命令怎么解决办法
- struts原理
- UILabel
- 本本win10的脾气,无法共享wifi
- SVM(Support Vector Machine)
- acm-hdu1874解题报告
- setlocale()函数使用
- leetCode 107.Binary Tree Level Order Traversal II (二叉树水平序)
- arm linux 启动代码分析(一)