Hello, I would like to be able to read a file that contains a list of database tables and loop through each entry and delete rows in the database for that entry. I thought you could do this with the cat command. I can not find examples any where. Could someone kindly provide a looping mechanism to read a file and do this? Thank you.
David 
David,
As we know, there are several ways to skin a cat.
Here is one form of looping using shell script:
while read EachRecord
do
echo "EachRecord = "$EachRecord
done < input_file
Sorry but I am new to shell scripting. Could you kindly explain what each line is doing. Where would I reference my file name as the input. Sorry for my ignorance. Thank you.
David
Here it goes:
while read EachRecord
The above line makes the loop happens reading each record from
the input file and assigning it to the variable "EachRecord".
do
The above line specifies the beginning of a block of statements
in this case, inside of the "while" loop.
echo "EachRecord = "$EachRecord
The "echo" statement displays on standard output -- screen.
In this case it is displaying a string "EachRecord = " and the content
of the variable "EachRecord".
done < input_file
The "done" is the end of block.
The "input_file" is to be replaced by your input file with your data.
Great! Thank you very much for you patients and help.
