A few commands I tried are
printf "%sn" >> file$DATE.txt echo -e "n" >> file$DATE.txt
What can be going on? Is it because I use Notepad?
Advertisement
Answer
In short, yes.
Notepad only understands DOS line-endings and not Unix line-endings. Use Wordpad or any other more capable editor to see the newlines correctly.
Alternatively, if you do want to create DOS/Windows line-ending files then use rn
in the printf
call as Barmar indicates in his comment.