I would like to use the tr
command to replace all occurrences of the string "\n" with a new line (\n).
I tried tr '\\n' '\n'
but this just seems to match any '\' and any 'n'
I would like to use the tr
command to replace all occurrences of the string "\n" with a new line (\n).
I tried tr '\\n' '\n'
but this just seems to match any '\' and any 'n'
Here's how to do it with
sed
:Example usage:
To replace all occurrences of
\n
in a file in-place:To replace all occurrences of
\n
through a pipe, and save into another file