Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am writing a script which writes XML code to a file. In this script i am writing the results of various processes into XML tags, but after a particular process the script terminates unexpectedly - i have identified the piece of code that causes the termination:
echo "<process>" >>$dir1
echo "<name>Database2</name>" >>$dir1
echo "<detail>" >>$dir1
sqlplus username/$PW@database2 <<EOF1 >>$dir1
@sql2.sql >>$dir1
exit
EOF1
echo "</detail>" >>$dir1
echo "</process>" >>$dir1The word "exit" seems to terminate the entire script whereas it should only exit from SQL, if i omit the word "exit" then the rest of the unix commands aren't recognised as i would be in SQL. I also have a similar process on database 1 which i run just before the above process and the code runs fine. Including the word "exit":
echo "<process>" >>$dir1
echo "<name>Database 1</name>" >>$dir1
echo "<detail>" >>$dir1
PW=$1
sqlplus username/$PW@database1 <<EOF1 >>$dir1
@sql1.sql >>$dir1
@sql15.sql >>$dir1
exit
EOF1
echo "</detail>" >>$dir1
echo "</process>" >>$dir1What i wish is for the second command to run including the writing of the final tags to the dir1 file and then move onto the next unix commands, whereas it currently terminates at the word exit.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |