Page 1 of 1

Add to Paper in Bash

Posted: 27 Jun 2018 05:25
by jdev21
I have been having some trouble appending a directory to a txt paper folder in bash.
I have found that I need to use iconv to convert the text to utf16 to even get it to appear properly in the text file (perhaps this is still the cause).
I'm using this command:

Code: Select all

echo -e "\nT:\OhHello" | iconv -f ascii -t utf16 >> /mnt/Paper/X.txt
This will add the new line to the paper folder but when I open XY, the folder does not appear and when I exit, it erases it from the text file.
The folder exists on T:\ (if I edit the paper folder manually it works).

Any ideas?

Re: Add to Paper in Bash

Posted: 27 Jun 2018 05:53
by jdev21
I found an answer. If anyone stumbles on this --
The paper .txt files also use CRLF line terminators which need to be added to the bash command with \r as follows:

Code: Select all

echo -e "\r\nT:\OhHello\r" | iconv -f ascii -t utf16 >> /mnt/Paper/X.txt