Thanks for the follow up.
The loop is for Periods 1-12, I simply want to run the same script 12 times for different periods of the month. The periods were originally formatted in 01,02, etc.
The password 'userpass' was just an easier place to enter the credentials from our TEST and PROD environments, I could have placed on the sqlplus line as easy.
Since the sql generates a large file, 10gig I didn't want to look at the spooling of data on the terminal and the only way to stop the output was passing in the file sqlcode.sql
Code:
!/bin/sh
set -xv
userpass=read
export ORACLE_HOME=/u01/app/oracle/product/11.2.0
export PATH=$PATH:$ORACLE_HOME/bin
for i in `seq 1 12`;
do
sqlplus table1/$userpass@Mytable <<EOF
@sqlcode.sql $i
EOF
done
same error... sorry I originally pulled out the path info in the script... there are 13 lines of code.
/test.sh: line 14: syntax error: unexpected end of file