Folks,
I am trying to call an sql script with 1 parameter from shell script. My scripts are as follows
tab.sql
set lines 500
col file_name for a80
select file_name,bytes/1024/1024,maxbytes/1024/1024
from dba_data_files
where tablespace_name=upper('&TAB_NAME');
/
and my shell script is test.sh is
#!/bin/bash
LOC=`pwd`
echo -n "Enter the name of the Tablespace: "
read -r TAB_NAME
sqlplus "/ as sysdba" <<- EOF
@$LOC/tab.sql $TAB_NAME
EOF
exit
When I execute the script this is what I am getting
sh test.sh
Enter the name of the Tablespace: users
SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 16 14:17:45 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected.
SQL> Enter value for tab_name:
SP2-0546: User requested Interrupt or EOF detected.
Enter value for tab_name:
SP2-0546: User requested Interrupt or EOF detected.
SQL> Disconnected
Can anyone tell me what is wrong here? I searched on net regarding this SP2-0546 but didn't resolved my issue. I am using 11.2.0.4 db on OLE-6
Thanks