The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 10-13-2005
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Try this:

Code:
#!/usr/bin/ksh

while read country count; do
   ### try to login to oracle and set some error condition
   if [ #the failure condition is set ]; then
      count=$(($count+1))
   fi
   echo $country $count >> your_file.tmp
done < your_file
mv your_file.tmp your_file
Some of the script is not real code, because I am not sure how you are going to check if you can connect to the database.