syntax error near unexpected token shell
来源:互联网 发布:手机身份证合成软件 编辑:程序博客网 时间:2024/06/06 11:44
出现syntax error near unexpected token问题示例:
出现此类错误都是因为不兼容的问题,在linux和windows高版本的操作系统下打开 .sh文件,会自动在每行的结尾加上 ^M
要想用/bin/bash 执行该文件,就必须去掉^M
方法如下:
1,用vi -b finame.sh 打开你的文件,你会发现每一行的结尾有一个^M.
2,shift+: (shift键+冒号) 在命令中输入:%s//^M//g (注意,^M是 ctrl+V,ctrl+V生成)。
回车后提示多少行已被更改,wq保存退出,再次用bash就可以执行了。。
阅读全文
0 0
- shell syntax error near unexpected token
- syntax error near unexpected token shell
- Shell:syntax error near unexpected token
- syntax error near unexpected token `
- syntax error near unexpected token `('
- “syntax error near unexpected token `”
- syntax error near unexpected token `
- shell---shell编程报错:“syntax error near unexpected token `”
- shell编程报错:“syntax error near unexpected token `”
- cygwin shell报错: syntax error near unexpected token `$'{/r''
- shell编程报错:“syntax error near unexpected token `”
- shell编程报错:“syntax error near unexpected token `”
- shell编程—syntax error near unexpected token
- shell编程报错:“syntax error near unexpected token `”
- shell “syntax error near unexpected token '$'\r''” 错误解决方法
- shell编程报错:“syntax error near unexpected token `”
- shell script中的syntax error near unexpected token `then' 问题
- linux--shell错误:syntax error near unexpected token ‘('
- Android 事件分发机制
- 使用 TestNG 创建一个数据驱动测试过程中遇到的问题
- Spring定时任务
- 正则_字符组笔记
- hashCode方法和equals方法
- syntax error near unexpected token shell
- Unity3D 攻击范围检测
- 微信小程序实例源码大全
- php authcode 混淆加密和解密
- 手动触发点击事件
- 过滤器(Filter)和拦截器(Interceptor)的区别
- UNIX环境编程学习笔记(26)——多线程编程(一):创建和终止线程
- Spring boot 学习笔记(三)
- vim: vs sp 调整窗口高度和宽度