I have a .txt file with the following content:
"[email protected]"
Now, I want to paste these strings with the help of my while loop to the stdout, in such a way that echo should write "text [email protected] text"
while read line;
do
echo "text $line text"
done <./textfile.txt
But all I get is: text"[email protected]"
--> The whitespaces are missing and the text after $line as well.
If I change it as below
while read line;
do
echo "text\ $line text"
done <./textfile.txt
I get text "[email protected]"
--> After the first text, there is a whitespace but after [email protected], there is no text.