The absolute best way to learn scripting is to first experiment with the basic commands---one at a time.
In this case, I think you are saying you have a file with a list of directory names---let's call it "namefile".
read name < namefile
Now do this:
while read name; do echo $name; done < namefile
Your script is now practically complete.....