Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping in Unix script.

Status
Not open for further replies.

jvbpro

Programmer
May 27, 2002
9
CA
Hi All, I need some help with some looping in UNIX script... Here is my problem.

E:/Transfer/LIMS/ folder is populated time to time with some .exp files that have the time stamp attached to their name (oracle export files eg. filename_yymmddhhmmss.exp.)

My script should import the data, for each of the export file in the folder, into a table.
I have the .par file already written... but this has the .exp file hard-coded.

userid=xxxx/xxxx
file=lims_assays.exp
fromuser=xxxxx
touser=xxxxx
tables=(lims_assays)
ignore=Y

Do you know how to process each file with UNIX script, and specify the name of the file to be imported as a parameter to the .par file?

this basically what i'm trying to do:

for each .exp file in the folder
truncate table lims_assay
imp parfile=imp.par
sqlplus ....
sqlplus ...
next file


Thank you in advance.
Jeya
 
It sound like you want:

for FILE in *.exp
do
## $FILE becomes each file in the list
## do some processing on $FILE
done
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top