Use this
cat file | while read -r a; do echo $a; done
where echo $a is whatever you want to do with the current line.
UPDATE:
If you don't have a file with the multiple lines but have a variable with multiple lines, then use the below code:
echo "$variable" | while read -r a; do echo $a; done
To know about Linux join the Linux training
Do check the below video