解决shell 报错:syntax error: unexpected end of file
debug shell:执行
sh -x test.sh
vi test.sh
:set fileformat=unix
:wq
解决问题原因是我在windows pycharm 写的格式不符合unix导致语法错误
解决shell 报错:syntax error: unexpected end of file的更多相关文章
- php Yii2使用registerJs或registerCss报错syntax error, unexpected end of file
解决方法: 注册时$js=<<<JS .....JS;//结尾处JS;应单独成行并且没有空格 JS;//这样就会报错,多了空格JS;//这样就不会
- 解决执行脚本报syntax error: unexpected end of file或syntax error near unexpected token `fi'错误的问题
参考:https://blog.csdn.net/u012453843/article/details/69803244 解决执行脚本报syntax error: unexpected end of ...
- Linux下docker报错syntax error:unexpected protocol at end of statement
---恢复内容开始--- [Linux]Shell脚本“syntax error: unexpected end of file”原因及处理 :::https://blog.csdn.net/u013 ...
- linux shell 报错 Syntax error: Bad for loop variable
在linux下写了一个简单的shell,循环10次. test.sh #!/bin/bash ## ##循环10次 ## ; i<; i++)); do echo Good Morning ,t ...
- php报错syntax error, unexpected T_GOTO, expecting T_STRING,报错文件与行数指向以下代码,是什么原因?
本机php版本是5.3.8,Apache/2.2.21public function goto($url, $msg=NULL) {if ($msg) {$this->jsAlert($msg) ...
- Shell脚本:“syntax error:unexpected end of file”
这种错误只能说是坑,如果没有见到过,很可能就要摔里头.解决问题是重要的,但弄明白问题的来源,往往更为重要. 所以要先扯一下,换行和回车的历史遗留问题. 在计算机出现之前,有个玩意叫电传打字机.每秒钟可 ...
- 报错解决——linux下执行sh出现异常"syntax error: unexpected end of file"
有时我们在linux下执行一个sh文件,会报错“SYNTAX ERROR:UNEXPECTED END OF FILE”,这个现象主要是工作的系统环境改变造成的. 若最初脚本中是在windows下,使 ...
- shell 报错:syntax error: unexpected end of file
有时执行脚本时会报错: [root@host1 shell]# sh -x test.sh + $'\r' : command not found test.: syntax error: unexp ...
- 页面白屏并且报错PHP Parse error: syntax error, unexpected end of file in 试了很久总算解决了
页面白屏并且报错PHP Parse error: syntax error, unexpected end of file in 试了很久 啥短标记,打开,都试了 最简单的办法 是重新建立一个文件, ...
- 关于报错“syntax error near unexpected token `”和回车换行
本来是很简单一个事情,转过来是因为打字机这事比较有趣…… http://blog.csdn.net/xyp84/archive/2009/08/11/4435899.aspx 摘要一下: 回车 换行 ...
随机推荐
- Linux相关知识笔记
Quagga要在linux下编译并配置运行,所有,学习一点linux的基础知识. 安装的Ubuntu,用户名linux,密码1 使能Ubuntu的IP转发功能,需要修改etc/sysctl.conf和 ...
- codewars--js--Large Factorials--阶乘+大数阶乘
问题描述: In mathematics, the factorial of integer n is written as n!. It is equal to the product of n a ...
- C# 根据天、周、月汇总统计生成统计报表
先看核心代码: public List<DataEntity> SearchShopSalesReport(DateTimeOffset? dateFrom, DateTimeOffset ...
- HTML连载70-相片墙、盒子阴影和文字阴影
一. 制作一个相片墙 二. <!DOCTYPE html> <html lang="en"> <head> <meta charset=& ...
- openlayers6结合geoserver利用WFS服务实现图层新增功能(附源码下载)
内容概览 1.openlayers6结合geoserver利用WFS服务实现图层新增功能2.源代码demo下载 效果图如下: 本篇主要是openlayers6通过调用geoserver发布的地图服务W ...
- CentOS、Ubuntu的安装
Linux使用最广泛的2个发行版:CentOS.Ubuntu. CentOS安全性高,常用作企业的服务器,Ubuntu常用作个人桌面. 常见的虚拟机有2个: VM VirtualBox,这个是Orac ...
- Ubuntu系统下使用php7+mysql+apache2搭建自己的博客
很多人都有写博客的习惯,奈何国内的博客网站正在一家家地关闭与重整,部分博客网站也充斥着太多的广告,使用体验非常不好.对于爱写博客的朋友来说,其实还有一个更好的选择,那就是自己搭建一个博客. 搭建一个自 ...
- 推荐一款疫情期间适合在家办公的远程工具,仅需IP和密码轻松实现远程管理
这段时间,受疫情影响,很多企业都开启了居家办公模式.但疫情突发,大多数人的办公资料没有拷贝打包,对于居家办公的人,尤其是运维人员来说,很难完成顺利完成工作. 像向日葵.teamviewer之类的远程软 ...
- JS淘宝小广告
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8 ...
- xshell/secureCRT连接Linux及其常用命令
一.xshell:在Windows界面下用来访问远端不同系统下的服务器,从而比较好的达到远程控制终端的目的 下载安装后连接步骤: 二.secureCRT:在Windows下登录UNIX或Linux服务 ...