I need to write a string to a file on a remote host using the python paramiko module. I tried various input redirection methods, but without success.
The local line in the code snippet below is populated with the result of the cat command
stdin, stdout, stderr = hydra.exec_command('cat /file.txt') localstring = stdout.read() manipulate(localstring) hydra.exec_command('cat > newfile.txt\n' + localstring + '\n')
My script seems to freeze or get an EOF error or have no resulting line in the file at all. Note that the file has several lines.
source share