When I use “cat test.file”, it will show
printf "This is a test log %d \n, testid";
1
2
When I use the bash file,
IFS=""
while read data
do
echo "$data"
done << test.file
It will show
printf "This is a test log %d n, testid";
1
2
The “\” is gone.
Is there any way that I can keep the “\” and space at the same time?
Try using
read -r.From the man page:
Execute this to test it: