while read p; do echo $p done < file.txt
while read p; do
echo $p
done < file.txt
this code can read all lines in the file.txt except the last line any
if youre in doubt about the last \n in the file, you can try:
\n
while read p; do echo $p done < <(grep '' file.txt)
grep is not picky about the line endings ;)
you can use grep . file.txt for skipping empty lines...
grep . file.txt