troubleshooting Question

Shell script syntax

Avatar of joaotelles
joaotellesFlag for United States of America asked on
Shell Scripting
4 Comments1 Solution295 ViewsLast Modified:
Hi,

Im trying to write a script for the following:

I have a file with a list of numbers (over 300)

So I want to input them into a SQL statament:

select * from todo where TODD='89014104254327F';

And them thrown it it a file.

So I thought something like this (not sure of the syntax)

while [ condition until the file finishes ]
do
output=`sqlplus -s ${db_user}/${db_pass}@${SID} <<!
      set heading off
      set feedback off
      select * from todo where TODD=${variable};
      exit;
      !`

${output} >> ultimate_file.txt

some counter for the condition??

done


===================

The file with the numbers looks like this:

525245
252524
252345
234245
242342
123123
144144
.
.


Tks,
joao
ASKER CERTIFIED SOLUTION
sakman

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros