Please read question slowly, its strange, but true.
In windows command prompt, I want echo
redirect to print \n
as new line to output file, but takes as literal(\n
) instead of new line.
echo "A\nB\n\C\n" > temp.txt
If I open the temp.txt
, I see output as
A\nB\n\C
rather then,
A
B
C
There is similar questions, like this and this on Stack Overflow. However, none of answer serves my purpose.
I tried, various other options, but didn't work are:
echo $'A\nB\nC' > temp.txt
echo $'A\\nB\\nC' > temp.txt
etc.
So, my question, is there to achieve new line I want to achieve in redirect?