Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Piet van Oostrum Newsgroups: comp.lang.python Subject: Re: pxssh sendline() cmd Date: Sat, 09 Feb 2013 00:39:58 +0100 Lines: 29 Message-ID: References: <9864afbd-a067-4606-8db5-cb86de12300c@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net 2yyeec0rPpjre2MgYqLcVA9YV1oP5FPv6nycfKdRg2UadaLDc+3U2THPdFZX0ySTt7 Cancel-Lock: sha1:ZkyaWRmVezC+sq2lsbe2LewktEM= sha1:m2rqpk3aauvYendY4FwFEY0wIVc= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3.50 (darwin) Xref: csiph.com comp.lang.python:38480 rajesh kumar 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 WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4]