Use while loop like this:
while IFS= read -r line || [ -n "$line" ]; do
echo "$line"
done <file
Or using grep
with while loop:
while IFS= read -r line; do
echo "$line"
done < <(grep "" file)
Using grep .
instead of grep ""
will skip the empty lines.
Note:
Using IFS=
keeps any line indentation intact.
File without a newline at the end isn't a standard unix text file.