dos2unix

PlatON在CentOS上编译部署

非 Y 不嫁゛ 提交于 2019-12-04 22:27:49
本文作者为万向区块链CTO罗荣阁。 目录 1. CentOS 环境准备 1.1. 使用rpm 安装devtoolset-7 1.2. 使用rpm 安装dos2unix 1.3. 准备Platon代码 1.4. 确保build脚本正常 1.5. 准备mpclib 1.6. 编译Platon 1.7. 重新编译前的清理工作 2. 初始化和运行Platon 2.1. Platon节点初始化 2.1.1. 生成 account 和 key pair 2.1.2. 配置初始化文件 2.1.3. 初始化Platon 2.2. 启动 Platon 节点 2.3. platon help 信息 2.4. 重新初始化Platon节点 3. CentOS升级gcc原始步骤 3.1. 安装CentOS-release-scl 3.2. 使用yum 安装devtoolset-7 3.3. 编译获得静态库libstdc++.so.6 Platon在CentOS上编译部署 PlatON官网上主要支持在 Ubuntu 和 Windows 环境中编译部署,但是也会有在CentOS上编译部署的需要。本文主要介绍了在CentOS上的环境准备、编译生成可执行文件和运行节点程序的过程。PlatON 官方代码库更新速度较快,有可能官方代码做出了一些设置变化,如果有步骤不能正确执行,可以参考 PlatON 官网具体信息。 1

Linux 运行shell文件,出现 $'\r': command not found

狂风中的少年 提交于 2019-12-04 06:45:38
运行编写的shell脚本时,出现了 $'\\r': command not found 这样的错误提示。 报错的原因是我们在windows系统操作时,编辑器里的换行符是\r\n ,而Linux上为\n,两个系统之间有差异导致的。 处理办法有2种: 1、vi 命令进入要编辑的文件,按ESC键进入命令模式,执行以下命令,按回车键,然后保存退出文件。 : set ff=unix 2、第二种 yum -y install dos2unix dos2nuix install.sh 上面的install.sh 就是你编写的脚本,用dos2nuix这个工具进行一下文件处理。 来源: https://my.oschina.net/jiemowudi/blog/3128505

dos2unix doesn't convert ^M

我们两清 提交于 2019-12-03 05:48:59
I exported results in a text file from a program running on Windows 7, and copied the file on Xubuntu 14.04. In a terminal, I ran dos2unix file.txt , which tells me converting file out_mapqtl.txt to Unix format . However, when I look at the file with less , I still see the Windows end-of-line as ^M, and wc -l returns me "0". I tried several things described here , but none works. I then opened the file in Vim and did :%s/\r/\r/g as explained there , which worked fine. So any idea why dos2unix didn't work? Would there be a way to avoid opening Vim every time? \r denotes a carriage return, and

Linux定时任务没有执行的总结

北慕城南 提交于 2019-12-03 04:01:26
昨天晚上让运维帮我更新上线了一个shell脚本,并添加到定时任务中准备凌晨12点06分执行,当我早上5点17醒来的时候,总感觉不对就去查邮件看看定时任务是否执行了,一看没有执行,然后直接远程到服务器,发现脚本执行只用了6秒,说明脚本是被调用了,那么就直接排除了缺少执行权限的问题,那到底是什么问题呢?随后又手动执行了一次,发现报错说脚本中有回车换行符,奇怪了,突然明白是windows和linux的编码格式不一样,马上用dos2unix对文件进行了转码,再执行,一切正常了,这点值得注意! 现在总结一下: 定时任务没有被执行有以下两种可能: 1、被执行的脚本没有执行权限,这种情况 直接授权 chmod 755 xxx.sh 2、被执行的脚本编码有问题,这种情况直接转码 dos2unix xxx.sh 我们也可下载一个windows版的dos2unix,转完码后再上传到Linux服务器 来源: oschina 链接: https://my.oschina.net/u/79159/blog/349716

dos2unix command

前提是你 提交于 2019-12-02 10:33:18
问题 I have this script #!/bin/sh for i in `ls -R` do echo "Changing $i" fromdos $i done I want to remove "^M" charcaters from many files which are in more subdirectories. I got this: fromdos: Unable to access file Is there somethig i'm missing? Thanks in advance. 回答1: I guess you don't need a for loop. Here is a quick panorama of solutions for files with extension ".ext" (such commands shall be somehow restrictive) note : ^M is obtained with CTRL-V" + "CTRL-M" # PORTABLE SOLUTION find /home -type

how to convert a file from DOS to Unix [closed]

不羁的心 提交于 2019-12-02 05:28:18
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I need to convert a file from DOS to Unix in PowerShell. I know this can be very much easily done in Unix: dos2unix file newfile 回答1: It could be as simple as Get-Content in.csv -raw | % {$_ -replace "`r", ""} | Set-Content -NoNewline out.csv Above method will work on powershell version 3+. If you are below that

Shell脚本之编码格式问题

北战南征 提交于 2019-12-01 19:33:02
shell脚本异常: /bin/sh^M:bad interpreter: No such file or directory 把sh脚本在windows下修改了下,放到linux下,总是运行不能成功,每个命令的最后都被加了一个M,查找了下,原因是因为编码格式引起的。 分析:这是不同系统编码格式引起的:在windows系统中编辑的.sh文件可能有不可见字符,所以在Linux系统下执行会报以上异常信息。 解决: 1)在windows下转换: 利用一些编辑器如UltraEdit或EditPlus等工具先将脚本编码转换,再放到Linux中执行。转换方式如下(UltraEdit):File-->Conversions-->DOS->UNIX即可。 2)也可在Linux中转换: #sh>vi filename 利用如下命令查看文件格式 :set ff 或 :set fileformat 可以看到如下信息 fileformat=dos 或 fileformat=unix 利用如下命令修改文件格式 :set ff=unix 或 :set fileformat=unix :wq (存盘退出) 3)使用dos2unix工具进行转换(sudo yum/apt-get install dos2unix) dos2unix filename dos2unix: converting file

FISCO-BCOS v1.3.1 通过物料包安装记录

半城伤御伤魂 提交于 2019-12-01 03:45:42
本文是从FISCO-BCOS的官方GitHub中的安装包进行安装的记录过程 1. Node.js环境准备 #nodejs安装 nvm curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash source ~/.bashrc nvm install stable #安装register管理器,切换taobao源,加快拉包速度 npm i -g nrm --registry=https://registry.npm.taobao.org nrm use taobao 2. Java环境准备 #需要安装Oracle Jdk #在Windows浏览器中访问 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 接收协议后点下载linux 64位安装包,在下载内容中得到重定向的下载地址(包含类似:AuthParam=1530691312_6e1e70a36909fffa55f461e9db6a284b 参数的) cd /data/env wget http://download.oracle.com/otn-pub/java/jdk/8u171-b11

What's the best way of doing dos2unix on a 500k line file, in Windows? [closed]

荒凉一梦 提交于 2019-11-30 04:45:12
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Question says it all, I've got a 500,000 line file that gets generated as part of an automated build process on a Windows box and it's

Convert files to UNIX format using Maven

半腔热情 提交于 2019-11-30 03:28:15
I have an application that is developed in a Windows environment. The application itself gets deployed to a Linux environment. Each time I deploy this application I have to convert executable files to UNIX format using dos2unix. I originally thought this was caused by the Windows CP1252 encoding, so I updated Maven to encode the files to UTF-8. This didn't solve my issue and I quickly found out that this has to do with carriage returns and line feeds by searching this site. Is there a way to have Maven convert all of the files to UNIX format during the build process? I am using Maven 2.2.1 and