Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38450 > unrolled thread

pxssh sendline() cmd

Started byrajesh kumar <chinna243@gmail.com>
First post2013-02-08 05:48 -0800
Last post2013-02-09 00:39 +0100
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  pxssh sendline() cmd rajesh kumar <chinna243@gmail.com> - 2013-02-08 05:48 -0800
    Re: pxssh sendline() cmd Piet van Oostrum <piet@vanoostrum.org> - 2013-02-09 00:39 +0100

#38450 — pxssh sendline() cmd

Fromrajesh kumar <chinna243@gmail.com>
Date2013-02-08 05:48 -0800
Subjectpxssh sendline() cmd
Message-ID<9864afbd-a067-4606-8db5-cb86de12300c@googlegroups.com>
Hi

I need help in pxssh.

Steps :
1) I was login into remote machine usning pxssh and the prompt is '$'.
2) After successful login running some command and the prompt is '>'.
3) Here onwards I want to execute cli commands by using sendline().

My requirement: I need to pass arguments to sendline().
var = "00:00:00:00:00:00:00"
name = F2

Example : sendline (X Y var name)

in above example X and Y are keywords separated by space. var and name are arguments.

Could any one help quickly. 

Note : If I use sendline(X Y 00:00:00:00:00:00:00  F2) was working fine.
 

[toc] | [next] | [standalone]


#38480

FromPiet van Oostrum <piet@vanoostrum.org>
Date2013-02-09 00:39 +0100
Message-ID<m2halmbcj5.fsf@cochabamba.vanoostrum.org>
In reply to#38450
rajesh kumar <chinna243@gmail.com> writes:

> Hi
>
> I need help in pxssh.
>
> Steps :
> 1) I was login into remote machine usning pxssh and the prompt is '$'.
> 2) After successful login running some command and the prompt is '>'.
> 3) Here onwards I want to execute cli commands by using sendline().
>
> My requirement: I need to pass arguments to sendline().
> var = "00:00:00:00:00:00:00"
> name = F2
>
> Example : sendline (X Y var name)
>
> in above example X and Y are keywords separated by space. var and name are arguments.
>
> Could any one help quickly. 
>
> Note : If I use sendline(X Y 00:00:00:00:00:00:00  F2) was working fine.
>  

sendline("X Y %s %s" % (var, name))
-- 
Piet van Oostrum <piet@vanoostrum.org>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web