简体   繁体   中英

Unexpected EOF error

I am getting error on below line in shell script i have tried Curly bracket but it wont work, my code is as follow:

VAL11=$(${ORACLE_HOME}/bin/sqlplus -s '/' << EOF
                SELECT COUNT(*) FROM DBA_USERS WHERE USERNAME=upper('$SCHEMA_NAME');
                EOF
                )

I am Getting Below error:

bkp_on_req_2.sh: line 74: unexpected EOF while looking for matching `)' bkp_on_req_2.sh: line 170: syntax error: unexpected end of file

thanks to NullDev

VAL11=$(${ORACLE_HOME}/bin/sqlplus -s '/' <<-EOF SELECT COUNT(*) FROM DBA_USERS WHERE USERNAME=upper('$SCHEMA_NAME'); EOF )

The ending tag for heredoc "EOF" should start from the first character of the line.

So third line of your code should be
EOF
instead of
           EOF

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM