hadoop老师给了一个shell文件,在windows里面瞅了一眼然后在ubuntu环境下运行就报错了。看了一些博客,用vim -b filename查看的时候发现每一行的末尾都多了一个^M.....

时间有限选择了一个简单的解决方法:dos2unix filename就可以了。

syntax error near unexpected token 脚本报错误解决的更多相关文章

  1. -bash: /etc/profile: line 11: syntax error near unexpected token `$'{\r''报错问题解决

    在Linux系统配置Java环境变量之后执行 source /etc/profile指令报:-bash: /etc/profile: line 11: syntax error near unexpe ...

  2. syntax error near unexpected token `then'问题的解决

    #!/bin/bash #if program test echo 'a:' read a if  [  "$a"  =  "English"  ];then ...

  3. syntax error near unexpected token `then'问题的解决

    http://blog.csdn.net/gongmin856/article/details/7690917 #!/bin/bash #if program test echo 'a:' read ...

  4. 写shell,运行出错:syntax error near unexpected token `$’do\r”

    cygwin下面写shell,运行出错:syntax error near unexpected token `$’do\r” 写shell,运行出错:syntax error near unexpe ...

  5. Shell脚本报错--syntax error near unexpected token for((i=0;i<$length;i++))

    现象: shell脚本使用Nodepad++进行本地编辑,在编辑后上传到linux机器进行执行时提示“syntax error near unexpected token for((i=0;i< ...

  6. 执行shell脚本提示“syntax error near unexpected token for((i=0;i&lt;$length;i++))”

    sh脚本例如以下: #!/usr/bin/env bash county="3 4 5 6 7 8 9 10 11 12 16 29 39 44 53 62 72 84 97 115 128 ...

  7. 关于报错“syntax error near unexpected token `”和回车换行

    本来是很简单一个事情,转过来是因为打字机这事比较有趣…… http://blog.csdn.net/xyp84/archive/2009/08/11/4435899.aspx 摘要一下: 回车 换行 ...

  8. shell编程报错:“syntax error near unexpected token `”

    今天写了个shell脚本,在自己机器上运行正常,给同事,运行报错syntax error near unexpected token `,左看右看shell脚本没有问题,没有办法google搜索,发现 ...

  9. Linix登录报"/etc/profile: line 11: syntax error near unexpected token `$'{\r''"

    同事反馈他在一测试服务器(CentOS Linux release 7.2.1511)上修改了/etc/profile文件后,使用source命令不能生效,让我帮忙看看,结果使用SecureCRT一登 ...

随机推荐

  1. 浅谈MongoDB基础及架构

    1.简述MongDB是一个强大.灵活而可扩展的数据存储系统,其将强大的可扩展特性与关系库最有用的特性进行了整合,像:次级索引,范围查询和排序等特性.而MongDB也内建了类似MapReduce汇聚和地 ...

  2. Bean的一生(Bean的生命周期)

    1. 什么是Bean? Bean是spring中组成应用程序的主体及由spring IoC容器所管理的对象(IoC容器初始化.装配及管理的对象).如果把spring比作一座大型工厂,那么bean就是该 ...

  3. XGBoost 参数介绍

    XGBoost 的设置有三种参数:一般参数,提升参数和学习参数. 一般参数 取决于提升器,通常是树或线性模型提升参数 取决于选择的提升器的相关参数学习参数 取决于指定学习任务和相应的学习目标一般参数 ...

  4. Ubuntu配置samba服务器

    假设我的Ubuntu用户名:myname 1. 安装和卸载samba: sudo apt-get install samba samba-common sudo apt-get autoremove ...

  5. CentOS7.5下实现MySQL5.7主从同步

    这里使用两台Linux主机(一台充当MySQL主服务器,另一台充当MySQL从服务器),MySQL用yum安装,版本均为5.7,下表是它们所使用的操作系统以及IP地址. 两台Linux主机所使用的操作 ...

  6. vs2017无法查看类图

    问题描述: 在解决方案右键项目,没有查看->查看类图选项 问题根据: VS安装时没有安装VS扩展中的类设计器 解决方案: 运行安装包,找到Other Tols勾选Visual Studio ex ...

  7. 深度学习查看GPU实时使用情况

    1.CPU使用情况查看 动态查看 打开终端,输入: $  top按Ctrl+C退出查看. 即可看到实时的CPU使用情况. 查看版本 $ top -h 即可看到当前procps-ng的版本. 2. gp ...

  8. JavaScript的深克隆与浅克隆

    JS数据类型分为两类: 基本类型(Number.Boolean.Undefined.Null.String.Symbol(ES6新加,此处不讨论))与引用类型(Object).原始类型存储的是对象的实 ...

  9. qhclass

    http://www.qhclass.com/classroom/62/courses

  10. opencv4.0.0+cmake编译(含contrib)

    https://blog.csdn.net/bobo184/article/details/88749651 前言笔者环境:win10+vs2015+cmake3.8.2 介绍下4.0.0的新特性,沿 ...