Here's the deal: I'm trying to write a string into a file, however, the file is located on a remote server to which I'm connected to via SSH. Basically, I'm SSHing into the remote server, and then running: echo "some text" >> somefile.txt That works great for single-line strings, but fails if the string has more than one line. An alternative ...