![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Top level TCSH while Loop doen't work | sprynmr | UNIX for Dummies Questions & Answers | 2 | 01-23-2009 09:07 AM |
| Seek UNIX script tutor and help | duke0001 | UNIX for Advanced & Expert Users | 2 | 05-12-2008 12:08 PM |
| The loop that dosent work | jadionne | UNIX for Dummies Questions & Answers | 12 | 01-11-2008 09:25 AM |
| Modify Perl script to work with txt - Permissions script | joangopan | Shell Programming and Scripting | 1 | 09-13-2007 12:38 AM |
| Script doesn't work, but commands inside work | cheongww | UNIX for Dummies Questions & Answers | 2 | 11-14-2006 10:52 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Why script For...Loop doesn't work. Seek help
I have written a script to run on UNIX server. When I tested, it always hanged on after "date +"%D %T: XXXXXX script started." part. Then it wouldn't go further. UNIX server gave me one error message. I used the same code in another script. It works fine. I think the major problem may be in For...Loop part. The script can not access into the $filename. I post code and error message here. Please help me to figure out where the bottleneck is. Thanks a lot
# Started DB Job on xxx table. for filename in directory_name/xxx_*.sql do sqlplus -s > temp.log 2>&1 dbuser/pswd@$ORACLE_SID @$filename If [ $? = 0] then date +"%D %T: $filename successully executed." >> xxxx.log else date +"%D %T: Error executing $filename." >> xxxx.log grep "ORA-" temp.log >> xxxx.log date +"%D %T: Exiting script." >> xxxx.log mail -s 'XXXX execution: Unsuccessful. See log file for errors.' mymail@company.com<xxxx.log exit 1 fi done # Delete temp.log file rm -f temp.log mail -s " XXXX execution: Successful" mymail@company.com <xxxx.log exit 0 Last edited by duke0001; 10-16-2006 at 07:59 PM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|