Ah, there were no details. Very well. The most general bash idiom
(also works in ksh):
exec 3<"$filename" # open the file
while IFS= read -r -u3 line; do
# do stuff with "$line" here
done
exec 3<&- # close the file
You can also just use input redirection on the whole loop (while...
do;...done <filename), but the exec method is the most flexible.
The IFS= disables whitespace separation so that whitespace in the
lines, even leading space, is preserved.