while read -r line; do echo "... $line ..." done <<< "$var" while read -r line; do echo "... $line ..." done < <(cat file) echo "... $line ..." done <file