解决Shell脚本$'\r': command not found问题
造成这个问题的原因是Windows下的空行,我们只需要把文件转成unix就好
Centos下,执行yum install dos2unix,然后dos2unix [file],再执行shell命令就好了
解决Shell脚本$'\r': command not found问题的更多相关文章
- 解决shell脚本错误$’r’ command not found
从windows上传了一个脚本到Linux上执行 出现如下错误:$'\r': command not found这是windows与Unix文本编辑的默认格式不同造成的,需要转成unix格式. 解决方 ...
- Linux Shell 错误: $'\r': command not found错误解决
在Linux下执行程序最省事的方式就是将系统的执行流程封装成一个shell脚本,上传到linux环境中后就可以直接执行了,但是今天在具体实施的时候出现了错误 $'\r': command not fo ...
- Shell脚本出现$'\r': command not found
Centos7下执行shell脚本报错如下 [root@ip---- ~]# sh install_zabbix_agent.sh install_zabbix_agent.: $'\r': comm ...
- shell脚本遇到问题"$'\r': command not found"
shell脚本写得一切正常,但是一执行就报错: line: XXX "$'\r': command not found" 问题原因:文件格式问题(虽然在window和linux上选 ...
- shell脚本执行错误 $'\r':command not found
shell脚本执行错误 $'\r':command not found Linux下有命令dos2unix 可以用一下命令测试 vi -b filename 我们只要输入dos2unix *.sh就可 ...
- 执行shell脚本出错'\r': command not found
在linux中执行脚本时出错 $'\r': command not found 错误原因是在脚本中有空行,如果脚本是在Windows下进行编辑之后上传到linux上去执行的话,就会出现这个问题. 因为 ...
- $'\r': command not found 或者 syntax error: unexpected end of file 或者 syntax error near unexpected token `$'\r''
执行shell脚本如果报如下错误: syntax error near unexpected token `$'\r'' syntax error: unexpected end of file $' ...
- $'\r': command not found
在Linux下执行程序最省事的方式就是将系统的执行流程封装成一个shell脚本,上传到linux环境中后就可以直接执行了,但是今天在具体实施的时候出现了错误 $'\r': command not fo ...
- Linux Shell系列教程之(二)第一个Shell脚本
本文是Linux Shell系列教程的第(二)篇,更多shell教程请看:Linux Shell系列教程 通过上一篇教程的学习,相信大家已经能够对shell建立起一个大体的印象了,接下来,我们通过一个 ...
随机推荐
- 【转载】如何查看sqlserver客户端的版本号信息
在sqlserver的使用过程中,有时候可能会因为sqlserver版本过低等原因的导致无法附加以及还原数据库,我们可以通过sql server management studio软件的帮助菜单参看到 ...
- Java 读取控制台输入
方式1:InputStreamReader+BufferedReader package my_package; import java.io.BufferedReader; import java. ...
- 图说jdk1.8新特性(5)--- 编译器新特性
/** * Returns the name of the parameter. If the parameter's name is * {@linkplain #isNamePresent() p ...
- 《我是一只IT小小鸟》读书笔记——第七周
我是一只IT小小鸟,每一个程序员都是从这样的阶段成长起来的,问题是是否能一开始就找到正确的路径,少走弯路.本书收集了许多年轻程序员从大学开始到就业的成长之路,十分有指导价值也很让人深思. 切忌急功近利 ...
- scrapy 管道里面使用mysql插入数据库
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to t ...
- PHP 接口输出 图片
html: <img src="{eq name='v.miniqrcode' value=""}{:url('makeMiniQrcode_do')}?id={$ ...
- 华为云主机配置yum源
问题: 拥有华为主机,配置华为云mirrors,不走公网流量加速体验 系统: centos7.6 解决: 01.华为云mirrors https://mirrors.huaweicloud.com/ ...
- A quick introduction to Source Insight for seamless development platform between Linux and Windows
前言 Source Insight是一个面向项目开发的程序编辑器和代码浏览器,它拥有内置的对C/C++, C#和Java等程序的分析.能分析源代码并在工作的同时动态维护它自己的符号数据库,并自动显示有 ...
- VS Code好用到飞起的配置设置
Visual Studio Code是一个轻量级但功能强大的源代码编辑器,可在桌面上运行,适用于Windows,macOS和Linux.它内置了对JavaScript,TypeScript和Node. ...
- 【Flask】 python学习第一章 - 6.0 WTF表单 数据库 蓝图
WTF表单 wtf.py pip install flask-wtf # 安装 from flask_wtf import FlaskForm from wtform import StringF ...