Computing.Net > Forums > Unix > Unexpected termination of script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Unexpected termination of script

Reply to Message Icon

Name: bhben
Date: November 1, 2004 at 02:49:26 Pacific
OS: Windows XP
CPU/Ram: P4, 512MB
Comment:

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>" >>$dir1

The 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>" >>$dir1

What 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.



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Unexpected termination of script

Perl Backup script www.computing.net/answers/unix/perl-backup-script/4265.html

Terminate paging after x number of msgs www.computing.net/answers/unix/terminate-paging-after-x-number-of-msgs/3400.html

permission denied problem of script www.computing.net/answers/unix/permission-denied-problem-of-script/5394.html