ksh -c "exit_code=0;
# Get a list of sql files and interate through them to do certain work on a 
DB.
    find ./sql_email_reports -maxdepth 1 -type f -print | while read line;
     do echo \"Report = \" \${line};
       
   #Now do some sql work on a DB based on the sql file as given by $line. 
           #and if the work to the DB fails for some reason, send back a 
return code greater than zero.
   rc=\$?;

   # Test the incrementation of exit_code by setting rc, which should 
increment exit_code for every file found in directory.
   rc=1
   
       echo \"rc = \" \${rc};
       (( exit_code+=rc ));
       echo \"Exit Code =\" \${exit_code};

     done;
 
 # For some reason, the tallied exit_code is not what it is within the 
while loop, it is still zero 
     
 echo \"Tallied exit_code = \" \${exit_code};
     (( exit_code > 0 )) && exit 1;
     exit 0;"

-- 
-- 
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at 
http://groups.google.com/group/linuxusersgroup
References can be found at: http://goo.gl/anqri
Please remember to abide by our list rules (http://tinyurl.com/LUG-Rules or 
http://cdn.fsdev.net/List-Rules.pdf)

--- 
You received this message because you are subscribed to the Google Groups 
"Linux Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to