Prevent “echo” from interpreting backslash escapes
问题 I'd like to echo something to a file that contains new line escape sequences, however I would like them to remain escaped. I'm looking for basically the opposite to this question. echo "part1\npart2" >> file I would like to look like this in the file $ cat file old part1\npart2 but it looks like $ cat file old part1 part2 回答1: This is a good example of why POSIX recommends using printf instead of echo (see here, under "application usage"): you don't know what you get with echo . You could get