Try https://devhints.io/bash (DevHints.io - useful resource)
cat file.txt | while read line; do echo $line done
for i in /etc/rc.*; do echo $i done