Bash EOF命令执行后';跑不动

Bash EOF命令执行后';跑不动,bash,shell,Bash,Shell,我在两台服务器上工作,一台是oracle数据库,另一台是linux,首先我导出了oracle服务器的路径,然后我想处理输出,结果显示bash命令未找到错误,我也尝试导出bash配置文件,下面是我迄今为止所做的: #!/bin/bash export ORACLE_HOME=/Oracle/app/oracle/product/11.2.0.2/db_1 export PATH=/Oracle/app/oracle/product/11.2.0.2/db_1/bin:. sqlplus syst

我在两台服务器上工作,一台是oracle数据库,另一台是linux,首先我导出了oracle服务器的路径,然后我想处理输出,结果显示bash命令未找到错误,我也尝试导出bash配置文件,下面是我迄今为止所做的:

#!/bin/bash
export ORACLE_HOME=/Oracle/app/oracle/product/11.2.0.2/db_1 
export PATH=/Oracle/app/oracle/product/11.2.0.2/db_1/bin:.
sqlplus system@xe/oracle123 << EOF >home/cron.log
@/home/test.sql > /home/zoutput/test.txt
EOF

echo "This is test"
#/bin/bash
导出ORACLE\u HOME=/ORACLE/app/ORACLE/product/11.2.0.2/db\u 1
导出路径=/Oracle/app/Oracle/product/11.2.0.2/db_1/bin:。
sqlplussystem@xe/oracle123 home/cron.log
@/home/test.sql>/home/zoutput/test.txt
EOF
回声“这是测试”
错误:意外标记“这是测试”附近的语法错误

#/bin/bash
导出ORACLE\u HOME=/ORACLE/app/ORACLE/product/11.2.0.2/db\u 1
导出路径=/Oracle/app/Oracle/product/11.2.0.2/db_1/bin:。
sqlplussystem@xe/oracle123 home/cron.log
@/home/test.sql>/home/zoutput/test.txt
EOF
echo(“这是测试”)
cut-c-3/Backend/home/zoutput/test.txt | sort | uniq
>/Backend/home/zoutput/test2.txt
错误
未找到剪切、排序、uniq命令

使用不带括号的echo

echo "This is test"

您认为您的脚本应该做什么?您的意思是完全丢弃预先存在的路径吗?在EOF命令运行后,由于它产生了语法错误,显然确实运行了该命令。通过shellcheck运行您的脚本(例如),修复错误,然后让我们知道您是否还有问题。主要问题是在EOF没有正确执行任何linux命令之后,EOF i not know@madof of cut-c-3/home/zoutput/test.txt | sort | uniq>/home/zoutput/test2.txt到底发生了什么(在该行之后,它显示未找到切割命令,之后我有一个下一个切割行命令,仅此命令起作用,但在这里它不起作用)
echo "This is test"