![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Running UNIX Commands from C | zainab | High Level Programming | 2 | 04-14-2008 08:35 PM |
| Problem in running bash shell commands on HP-UX machine | abhishek0071 | UNIX for Advanced & Expert Users | 6 | 02-15-2008 11:30 AM |
| calling plsql function in a unix script | cobroraj | UNIX for Advanced & Expert Users | 2 | 10-29-2007 07:06 PM |
| Running UNIX commands remotely in Windows box from Unix box – avoid entering password | D.kalpana | UNIX for Dummies Questions & Answers | 1 | 04-20-2007 02:24 AM |
| running commands from script | owijust | Shell Programming and Scripting | 2 | 01-09-2006 02:12 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Problem running plsql & unix commands in 1 script
Hi, I need help again. When I run this shell script, it only runs the unld_date.sql piece and exits. How can I structure this to run all the way to the end? When I don't have the unld_date.sql piece in here, everything runs fine from the date compare piece all the way to the end. Thanks in advance.
#!/bin/sh # sqlplus -s <<EOF username/password @/dir1/unld_date.sql > /dir2/dt_file.dat exit 0 # dt=`cat dt_file.dat` today_dt=`date +%m%d%Y` if [ "$dt" = "$today_dt" ] then # # run pl/sql procedures 1 and 2 sqlplus -s <<EOF username/username @/dir3/code1.prc > /dir4/code1.log @/dir3/code2.prc > /dir4/code2.log exit EOF # tail -10 /dir4/code1.log > log1.txt tail -10 /dir4/code2.log > log2.txt # exit |
| Forum Sponsor | ||
|
|
|
|||
|
Am I missing something?
If this is really how your script reads, the "exit 0" is going to terminate your script every single time once "unld_date.sql" has been executed.
If it is working with "unld_date.sql" removed then you must also be removing "exit 0". The "exit 0" statement is not tied to the sqlplus command. So the simple answer to your question is to remove "exit 0". |
|
|||
|
Quote:
You either need to add the "EOF" as stated by other posters or remove the "<<EOF". sqlplus will run the SQL at this point and let your script continue. |
|||
| Google The UNIX and Linux Forums |