View Single Post

  #1 (permalink)  
Old 07-22-2005, 01:17 AM
mustang mustang is offline
Junior Member
 
Join Date: Jul 2005
Posts: 1
Rep Power: 0
mustang
Default Need Help reading files

Hi all,

I am new to unix shell scripting. I want to write a bash shell script.

I have a text file say "sample.txt" which has entries seperated by space or commas.

table_name,schema_name,no_of_days_to_delete_data
table1,sam,25
table2,jim,30
table3,kim,15

I want to read line by line the above sample.txt file in my shell script and pass these 3 parameters in one line to some oracle procedure while looping it..

pseudocode as follow:
-------------------------
open sample.txt file
while not end of file
read one line
pass the values to some oracle procedure..
end while loop
close file.


How do I achieve the above functionality in shell script?

New Beginner..please help me.

Note : OS is Linux Platform.
I need the 3 parameters to be passed to oracle procedure to delete some data which might take a while finishing the procedure...then I will read the next line and pass these parameters again to oracle and so on....

Regards
Mustang
Reply With Quote