Pexpect getting a defuct process

Discussion in 'Python' started by Baillargeon, Sonny, Jan 4, 2005.

  1. I am trying to use a pexpect script using python v2.3.4 with pexpect
    module .999 on Solaris 8.

    I try to execute this script.

    #!/usr/bin/env python
    '''This runs "ls -l" on a remote host using SSH.
    At the prompts enter hostname, user, and password.
    '''
    import pexpect

    logfile = open('sshls.log', 'w')

    child = pexpect.spawn('ssh user@server ls -la')
    child.setlog(logfile)
    child.setmaxread(1000)
    child.expect(pexpect.EOF, timeout=180)
    print child.before

    This used to work before but now I get a defunct process after it runs.
    Any ideas?

    Thanks,
    Sonny


    <FONT SIZE = 1>****************************************************************************
    This e-mail and any attachments may contain confidential and privileged information. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this e-mail and destroy any copies. Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal. Unless otherwise stated, opinions expressed in this e-mail are those of the author and are not endorsed by the author's employer.</FONT>
    Baillargeon, Sonny, Jan 4, 2005
    #1
    1. Advertising

  2. Baillargeon, Sonny, Terça 04 Janeiro 2005 14:42, wrote:

    > This used to work before but now I get a defunct process after it runs.
    > Any ideas?


    "before" what? What has changed in your environment to make it stop
    working?

    --
    Godoy. <>
    Jorge Luiz Godoy Filho, Jan 4, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Baillargeon, Sonny

    RE: Pexpect getting a defuct process

    Baillargeon, Sonny, Jan 4, 2005, in forum: Python
    Replies:
    1
    Views:
    439
    Jorge Luiz Godoy Filho
    Jan 4, 2005
  2. Karim Bernardet

    get the pid of a process with pexpect

    Karim Bernardet, May 5, 2008, in forum: Python
    Replies:
    2
    Views:
    554
    Karim Bernardet
    May 6, 2008
  3. Saqib Ali
    Replies:
    0
    Views:
    176
    Saqib Ali
    Dec 21, 2011
  4. Saqib Ali
    Replies:
    1
    Views:
    358
    Roy Smith
    Dec 26, 2011
  5. Z W
    Replies:
    0
    Views:
    171
Loading...

Share This Page