linux shell 环境下unexpected end of file的错误解决

来源:互联网 发布:一万条数据 多少m 编辑:程序博客网 时间:2024/06/05 22:56
 warning: here-document at line 5 delimited by end-of-file (wanted `EOF')

 syntax error: unexpected end of file

不要用EOF,换成别的名字,比如FLAGEOF,因为EOF本身就是一个linux命令。

第二个结束标志必须顶格写,前后都不能有空格。

比如:

#!/bin/bash

 /usr/bin/expect <<FLAGEOF
        send "exit\r"
FLAGEOF

0 0
原创粉丝点击