# while

Read from file:

while read line; do
echo $line
done < temp.txt

Read from file but parse file before piping into while loop:

while read line; do
curl -sL -w "%{http_code} %{url_effective}\\n" "https://example.com$line" -o /dev/null
done < <(cut -d' ' -f1 static/_redirects)

Read from HERE doc:

while read line; do
echo $line
done << EOF
LINE-1
LINE-2
LINE-3
EOF

References