Hello, I am trying to read a file on a remote server, which is on a Unix box. I don't mind if I can read it into a Stringbuilder or a file. The normal
which works well on windows would work for me.
So I am using SSH to connect, and then I am running commands
eg Cat /var/log/logfile.
I can view the content of the file on the console, but I cannot save it to a string or write to the file. I am having a nightmare with Converting the OutputStream to String or even FileOutputStream
here is a snippet
So my question is this, after running the command, I can see the command and the returned stuff in the console, but I am not having any luck writing the content into the file. I am able to write the first line into the file - out.write((command+";echo \'z4a2ce4f3317Z\'").getBytes()); this writes the command into the file, but the next lines which contains stuff returned is not copied to the file