shell中出现syntax error: unexpected end of file
来源:互联网 发布:淘宝sku是什么意思 编辑:程序博客网 时间:2024/05/16 01:12
写了如下shell,结果运行报syntax error: unexpected end of file
while true
do
sqlplus / as sysdba << EOF!
select sysdate from dual;
此处不顶行写 EOF!
done
原来下面这个EOF!必须要顶行写。如果没有循环!EOF可以随便放什么位置,但是在循环中属于Here Documents,这个EOF!是代表Here Documents的结束。此处不能像写C程序一样,为了美观而把EOF!向右缩进,因为SHELL规定!EOF必须是该行唯一出现的内容,连空格都不能有。因此,这个EOF!就暂时突出在这一行了。
去掉循环,直接写是可以运行的。
sqlplus / as sysdba << EOF!
select sysdate from dual;
EOF! # 前面有没有空格都不受影响
转贴: http://www.tanyangxf.net/2011/05/shell%E4%B8%AD%E5%87%BA%E7%8E%B0syntax-error-unexpected-end-of-file/
- shell中出现syntax error: unexpected end of file
- Shell中EOF出现syntax error: unexpected end of file
- shell中出现syntax error: unexpected end of file
- shell:syntax error:unexpected end of file
- 关于shell文件中出现syntax error: unexpected end of file
- SHELL syntax error:unexpected end of file 提示错误
- Shell 尴尬: syntax error:unexpected end of file
- 解决shell错误:syntax error: unexpected end of file
- SHELL syntax error:unexpected end of file 提示错误
- shell脚本“syntax error:unexpected end of file”解决方案
- shell入门的拦路虎:syntax error: unexpected end of file
- shell错误一例 syntax error: unexpected end of file
- Linux Shell syntax error: unexpected end of file
- linux-shell syntax error: unexpected end of file
- SHELL syntax error:unexpected end of file 提示错误
- SHELL syntax error:unexpected end of file 提示错误
- shell脚本“syntax error:unexpected end of file”解决方案
- SHELL脚本“SYNTAX ERROR:UNEXPECTED END OF FILE”解决方案
- 有关window.onerror事件的监听及用法
- SAFEARRAY使用实例
- uafxcwd.lib 与 LIBCMTD.lib
- axis2 服务器未能识别 HTTP 头 SOAPAction 的值 解决办法
- document.body.scrollwidth 网页高度宽度的写法
- shell中出现syntax error: unexpected end of file
- java.util.concurrent.CountDownLatch类详解及例子
- jquery基本操作
- sql server2005发布和订阅
- 一个不错的Jquery日期文本框选择控件
- Android访问本机ip
- 单片机机存储器类型分析(data,xdata,code,pdata,bit)
- VIM 快捷键(转)
- ARM处理器工作模式