使用cygwin出现syntax error near unexpected token'$'do\r
直接从csdn复制粘贴的.sh代码,放到cygwin下运行sh的时候出错syntax error near unexpected token'$'do\r

解决方法:
1.下载notepad++
2.用notepad plus打开这个.sh文件,右击使用这个打开,视图->显示符号->显示所有符号

发现后面都是windows下的空格CRLF,
3.我们改为linux下的。。编辑->文档格式转换->转换为UNIX格式:保存

4.在cycwin下运行这个.sh就ok了

使用cygwin出现syntax error near unexpected token'$'do\r的更多相关文章
- 写shell,运行出错:syntax error near unexpected token `$’do\r”
cygwin下面写shell,运行出错:syntax error near unexpected token `$’do\r” 写shell,运行出错:syntax error near unexpe ...
- Linux 中出现的-bash: syntax error near unexpected token `
版权声明:本文为博主原创文章,未经博主允许不得转载. 在Linux 5中导入数据时,出现下面的错误. -bash: syntax error near unexpected token `(' 检查了 ...
- -bash:syntax error near unexpected token '('
在Xshell5中编写int main(int argc,char** argv)时, 出现-bash:syntax error near unexpected token '(' : 可是我是按照 ...
- linux后台执行./run.py提示python syntax error near unexpected token `('
python脚本中的#!/usr/bin/python 估计有不少人注意过一些python脚本开头有这么行东东: #!/usr/bin/python 它是用来干嘛的?貌似没有它对脚本功能也没啥 ...
- shell编程报错:“syntax error near unexpected token `”
今天写了个shell脚本,在自己机器上运行正常,给同事,运行报错syntax error near unexpected token `,左看右看shell脚本没有问题,没有办法google搜索,发现 ...
- libtool: syntax error near unexpected token `]*
../libtool: line 543: syntax error near unexpected token `]*' ../libtool: line 543: ` *[\[\~\#\ ...
- syntax error near unexpected token‘(
用虚拟机的时候出现这样的: 上网查了资料之后,在括号"( " 前加上"$"字符就暂时不会提示出错了.
- syntax error near unexpected token `then'
#!/bin/bashclearfunction test{ if[$1 -eq "root"]&&[$2 -eq "123456"] ...
- shell脚本启动语法错误syntax error near unexpected token '{
执行shell脚本时失败,报语法错误,但脚本内容检查正常 原因为该脚本是在非Linux系统下编辑之后放到系统执行的,文件模式类型非Linux系统匹配的模式类型. 查看文件的模式类型 显示文件的模式类型 ...
随机推荐
- hadoop Error: JAVA_HOME is not set and could not be found.
Hadoop安装完后,启动时报Error: JAVA_HOME is not set and could not be found.解决办法: 修改/etc/hadoop/hadoop- ...
- Linux下配置SVN
1.安装svn yum -y install subversion 2.创建SVN版本库目录 mkdir -p /var/svn/svnrepos (-p参数:如果没有这个目录,则创建这个目录) 3. ...
- 创建catalog数据库
1数据库版本 2环境准备 3目录数据库准备 4创建目录数据库 5使用目录数据库
- oracle空间管理
表空间:组织数据文件的一种途径, 是一个逻辑概念 包含有 表,字段,索引 一个数据库可以对应多个表空间 一个物理文件对应一个表空间 任何一个数据库创建的第一一个表空间是 system Tables ...
- jsp&Sevelet基础详解
1.用scriptlet标签在jsp中嵌入java代码: (1).<%!...%>可以在里面定义全局变量,方法,类,一般写在<head>内 (2).<%%>定义的是 ...
- HTML5文件API
File对象与File对象 Blob对象 FileReader对象 File对象 <!DOCTYPE html> <html> <head> <meta ht ...
- Android课程---优化ListView列表视图
activity_ui4.xml <?xml version="1.0" encoding="utf-8"?> <ListView xmlns ...
- Stream Processing for Everyone with SQL and Apache Flink
Where did we come from? With the 0.9.0-milestone1 release, Apache Flink added an API to process rela ...
- 一些IT中的工具介绍【转】
1. 史上最全github使用方法:github入门到精通 2. Git教程 3. GIT与GitHub使用简介 简单来说,git是一种版本控制系统.跟svn.cvs是同级的概念.github是一 ...
- iOS仿网易新闻栏目拖动重排添加删除效果
仿网易新闻栏目选择页面的基本效果,今天抽了点时间教大家如何实现UICollectionView拖动的效果! 其实实现起来并不复杂,这里只是基本的功能,没有实现细节上的修改,连UI都是丑丑的样子,随手画 ...