Read line from file and put into variable, linux shell

var=$(cat "file.lst")
printf %s "$var" | while IFS= read -r line
do
   echo "$line"
done
To execute more commands use
var=$(cat "file.lst")
printf %s "$var" | while IFS= read -r line
do {
   echo "$line"

}
done

No comments: