The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 06-29-2009
whoknows whoknows is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 5
Red face

Thanks! -- I will try this.

---------- Post updated at 10:56 AM ---------- Previous update was at 08:27 AM ----------

OK -- this is what I did:

cat *.sum >> recsum
sort -u -o recsum.sort recsum
print "** Total Records"| tee -a ${logfile}
while read id ; do
sqlplus -s ${lgn} << EOF | tee -a ${logfile}
select count(PC.tran_nbr)
from ptcpnt_cmpsit PC
where
PC.ptcpnt_id = $id
and PC.gndr_type = 'F'
;
exit;
EOF
done < recsum.sort
print "\n${sn}: COMPLETE [$(date)]:
Output appended to log file [${logfile}]
" | tee -a ${logfile}
echo > recsum

Assume I have a couple of files named *.sum in my directory.
My output is going to the logfile, but it is also going to the screen:
COUNT(PC.PTCPNT_ID)
----------------------
0
1 row selected.

COUNT(PC.PTCPNT_ID)
----------------------
1
1 row selected.

COUNT(PC.PTCPNT_ID)
----------------------
0
1 row selected.

I don't want it to go to the screen. It also seems to be in an infinite loop. It never ends. This is an example of a couple of rows in my file (total rows around 5000):

600010001
600010060
600010065
600010070
600010090
600010120