> Piet van Oostrum (PvO) wrote:
[snip]
>PvO> You can also consider using paramiko instead of pexpect.
[snip]
> chan = t.open_session()
> chan.exec_command('cat')
> chan.send('abcdefghijklmn\n')
In a real program it is better to use sendall here, as send may decide
to send only pa
> Hussein B (HB) wrote:
>HB> Hey,
>HB> I'm trying to execute a command over a remore server using pexpect
>HB> +
>HB> url = 'ssh internalserver'
>HB> res = pexpect.spawn(url)
>HB> print '1'
>HB> res.expect('.*ssword:')
>HB> print '2'
>HB> res.sendline('mypasswd')
>HB> print '3