首页
Python
Java
IOS
Andorid
NodeJS
JavaScript
HTML5
【
Shell脚本报错--syntax error near unexpected token for((i=0;i<$length;i++))
】的更多相关文章
Shell脚本报错--syntax error near unexpected token for((i=0;i<$length;i++))
现象: shell脚本使用Nodepad++进行本地编辑,在编辑后上传到linux机器进行执行时提示“syntax error near unexpected token for((i=0;i<$length;i++))” 解决方案: 思路:经查询是因为所处理的文件换行符是dos格式的"\r\n",可以使用cat -v 文件名 来查看换行符是否是,如果是上述,则行尾会是^m 解决: 使用sed命令处理一下文件,使格式保持为linux格式,如下…
关于报错“syntax error near unexpected token `”和回车换行
本来是很简单一个事情,转过来是因为打字机这事比较有趣…… http://blog.csdn.net/xyp84/archive/2009/08/11/4435899.aspx 摘要一下: 回车 换行 0D 0A <CR> <LF> Carriage Return Line Feed “/r” “/n” win32 0D 0D 0A unix 0D 0A ============淡定的分割线=============== 今天写了个shell脚本,在自己机器上运行正常,给同事,运行报…
执行shell脚本提示“syntax error near unexpected token for((i=0;i<$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 151 168 187 199 218 230 10079 10239 32478" array=($county) length=${#array[@]} for((i=0;i<$length;i++)) do $HIVE_HOME/bin/hive -e "select * f…
shell编程报错:“syntax error near unexpected token `”
今天写了个shell脚本,在自己机器上运行正常,给同事,运行报错syntax error near unexpected token `,左看右看shell脚本没有问题,没有办法google搜索,发现一位仁兄讲的挺好,内容如下: 用命令vi -b 打开你的SHELL脚本文件,你会.发现每行脚本最后多了个^M. 那么接下来就要搞清楚这个^M是什么东东? long long ago..... 老式的电传打字机使用两个字符来另起新行.一个字符把滑动架移回首位 (称为回车,<CR>,ASCII码为0…
-bash: /etc/profile: line 11: syntax error near unexpected token `$'{\r''报错问题解决
在Linux系统配置Java环境变量之后执行 source /etc/profile指令报:-bash: /etc/profile: line 11: syntax error near unexpected token `$'{\r''如下图: 错误提示信息已经反馈/etc/profile里面有一些异常,初步检查/et/profile文件后,没有发现异常,很是奇怪,后面我使用cat -v /etc/profile检查,发现里面大量的Windows下的换行符.如下截图所示 得知是Linux和wi…
syntax error near unexpected token `do(写的shell脚本出现格式问题)--->1.问题2.展示信息3.解决方案
1问题:Linux和windows下的回车换行符不兼容的问题 [root@node-01 script]# sh start_zk.sh art_zk.sh: line 3: syntax error near unexpected token `do'tart_zk.sh: line 3: `do 2.展示信息: 此处我贴出了源码;大家可以试一试: #!/bin/shfor host in node-01 node-02 node-03do ssh $host "source /etc/pro…
写shell,运行出错:syntax error near unexpected token `$’do\r”
cygwin下面写shell,运行出错:syntax error near unexpected token `$’do\r” 写shell,运行出错:syntax error near unexpected token `$’do\r” [问题] 在cygwin下,用notepad++写了个简单的shell脚本,内容如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 #!/bin/bash #remove *.bak in subfolder files echo 'remov…
shell出现syntax error near unexpected token `<' 解决方法
最新在看一个shell资料时,按照教材,却出现如下错误,不能运行 如下,简单的脚本: #!/bin/bash cat |while read line do echo $line done < <(data.txt|awk '{print $0}') 运行时,却出现如下错误 [root@localhost shellcookbook]# sh while_test.sh while_test.: syntax error near unexpected token `<' while_t…
JS function document.onclick(){}报错Syntax error on token "function", delete this token
JS function document.onclick(){}报错Syntax error on token "function", delete this token function document.onclick() //任意点击时关闭该控件 //ie6的情况可以由下面的切换焦点处理代替 { with(window.event) { if (srcElement != outObject && srcElement != outButton) …
一个参数大小写引发的uploadify报错 "Syntax error, unrecognized expression: #"
上传控件uploadify 报错"Syntax error, unrecognized expression: #" 版本为 uploadify3.2 报错原因:参数ID[hidInfoId]小写错写成了大写. debug过程: ①:报错 "Syntax error, unrecognized expression: #" ②:该错误为jQuery 选择器#取不到ID取ID错误,确定某个ID为空. 可以看到hidInfoId这个参数为空 找到报错的地方. 代码中…