运行shell脚本报错: syntax error near unexpected token `'\r''
来源:互联网 发布:网络市场监管系统 编辑:程序博客网 时间:2024/05/31 00:40
原因:文本中存在换行符,一般是由于在windows下写的txt文件然后改后缀名为sh造成的,要知道,linux和windows是水火不容的!
解决办法:
1、vi 进入编辑页面
2、执行:e ++ff=unix %
然后删除^M符号
3、:wq
退出,就可以了
0 0
- 运行shell脚本报错: syntax error near unexpected token `'\r''
- cygwin shell报错: syntax error near unexpected token `$'{/r''
- shell 脚本报错^M: syntax error near unexpected token
- 脚本报syntax error near unexpected token `(',
- shell---shell编程报错:“syntax error near unexpected token `”
- syntax error near unexpected token `$’do\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 `”
- shell编程报错:“syntax error near unexpected token `”
- shell编程报错:“syntax error near unexpected token `”
- shell编程报错:“syntax error near unexpected token `”
- rsync 脚本报错 “syntax error near unexpected token `(”
- 脚本报错:syntax error near unexpected token
- mac上运行报错:syntax error near unexpected token `('
- linux执行SHELL脚本报错“syntax error near unexpected token `in”解决
- PHP HOOK的若干方法
- 【解题报告】POJ1151 扫描线+线段树(矩形求并)
- python 列表及字典(按key、按value排序)
- STM32 USART 串口 DMA 接收和发送的源码详解!
- python chr(i)
- 运行shell脚本报错: syntax error near unexpected token `'\r''
- 腾讯云CentOS7.2 PHP-SDK镜像服务器根目录(腾讯云微信小程序服务端Demo -PHP 页面根目录)
- Amazon EC2学习笔记(一)
- HTTP GET的三种方式
- 内存池
- snprintf函数用法
- Android系统中标准Intent的使用
- 大话数据结构一:线性表的顺序存储结构
- NY12 格式转化成RGB格式