0

I need to create a file by modifying some lines of a source one. I developed a loop 'while read line; do'. Inside it, the lines I read and don't modify go just:

echo -e "$line" >> "xxxx.c"

My issue is that some of that lines start with '\t', and they won't print the output file.

Example:

while read line;   
do                                                             
if echo "$line" | grep -q 'timeval TIMEOUT = {25,0};'                    
then
  echo "$line"
fi

Any help? I've tried with the printf command also but without success.

sjsam
  • 21,411
  • 5
  • 55
  • 102
Joster
  • 359
  • 1
  • 4
  • 19

1 Answers1

1

In that case you could just remove "-e" argument from the echo command.

From echo man page:

-e enable interpretation of backslash escapes 
Zuzzuc
  • 148
  • 9