I have a text file with the following contents,
My test
strings
that dont have
a question
mark except this line?
but not
these two
and when i try to read the file in bash using, for example,
ph_lines="/path/to/file.txt"
for l in $(cat "$ph_lines")
do
echo "$l"
done
everything prints on the output except for the string with the question mark in it.
I have tried using while read line; echo line; done < $filename
and it still has the same problem
The only thing that would work to capture all of the lines is when i used sed to remove question marks.
for l in $(cat ${ph_lines} | sed $'s/\?//' )
Thank you!