linux中的unix2dos等价物

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10654306/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 06:23:23  来源:igfitidea点击:

unix2dos equivalent in linux

linuxunixmigration

提问by Sachin Chourasiya

I am planning to migrate my application coded in C/C++ and running on UNIX to Linux Suse 11.1. I have some places where unix2dos is used. I knew that flip is alternative to unix2dos in linux. Please let me know is there any risk involved in using flip on linux as unix2dos equivalent?

我计划将使用 C/C++ 编码并在 UNIX 上运行的应用程序迁移到 Linux Suse 11.1。我有一些使用 unix2dos 的地方。我知道在 Linux 中,flip 是 unix2dos 的替代品。请让我知道在 linux 上使用 flip 与 unix2dos 等效是否有任何风险?

回答by KurzedMetal

Linux does have unix2dosand dos2unix.

Linux 确实有unix2dosdos2unix.

回答by octopusgrabbus

Most Linux distributions I know of include unix2dosand dos2unix. As of Ubuntu 10.04, these utilities were dropped from the default installation, but were easily added by installing to tofrodospackage using the following command.

我所知道的大多数 Linux 发行版都包含unix2dosdos2unix. 从 Ubuntu 10.04 开始,这些实用程序已从默认安装中删除,但可以通过tofrodos使用以下命令安装到包中轻松添加。

sudo aptitude install tofrodos

sudo aptitude install tofrodos

To date, both Red Hat and its non-branded CentOS cousins have always contained these utilities.

迄今为止,Red Hat 及其非品牌 CentOS 同类产品一直包含这些实用程序。

回答by Bee Kay

CentOS no longer includes it in a default distro, but is readily available.

CentOS 不再将其包含在默认发行版中,而是随时可用。

Command:

命令:

yum install unix2dos

You may as well install its mirror image, dos2unix

你也可以安装它的镜像,dos2unix

yum install dos2unix

For some reason, saving 35k of space on a distro was that important, so we can keep updating threads like this.

出于某种原因,在发行版上节省 35k 空间是如此重要,因此我们可以像这样继续更新线程。

:| have an edited day.

:| 有一个编辑的一天。

回答by Erwin Waterlander

On Ubuntu dos2unix is in the Universe repository. sudo apt-get install dos2unix

在 Ubuntu 上 dos2unix 位于 Universe 存储库中。sudo apt-get 安装 dos2unix

See also http://packages.ubuntu.com/cgi-bin/search_packages.pl?keywords=dos2unix&searchon=names&version=all&release=all

另见http://packages.ubuntu.com/cgi-bin/search_packages.pl?keywords=dos2unix&searchon=names&version=all&release=all

Linux Mint: http://community.linuxmint.com/software/view/dos2unix

Linux Mint:http: //community.linuxmint.com/software/view/dos2unix

The risk of flip is that you might convert Unix line breaks to DOS line breaks, while you expected the opposite.

翻转的风险是您可能会将 Unix 换行符转换为 DOS 换行符,而您的预期正好相反。