[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

expect trouble

Hi all,

Ever since hamm, expect has been giving me serious trouble. It won't
run cleanly when started from cron. This means that a lot of my
expects scripts are broken. I use expect extensively for system
maintanance and accounting (make sure servers run, upload websites and
databases, etc)

Typically if run from cron scripts will barf:

spawn sh 
failed to get controlling terminal using TIOCSCTTY
parent: sync byte write: broken pipe

I use a simple test script like shown below. I also notified the
expect maintainer some time ago, and he thought it might be a libc6
problem. This behaviour has also been noticed on Redhat, and last
reports have it, they havent fixed this either.

Anyone any ideas or clues as to how to solve this, or when to expect
this to be solved ?

----------- test.exp --------------
#!/usr/bin/expect --

proc shell_spawn {} {
    spawn sh
    expect "sh"
    return $spawn_id

match_max 1000
set timeout -1
spawn sh
expect "sh"

set spawn_id [ shell_spawn ]

# __MAIN__():
send -- "logout\r"
sleep 2


  Paul Stevens                                  mailto:paul@nfg.nl
  NET FACILITIES GROUP                     PGP: finger paul@nfg.nl
  The Netherlands________________________________http://www.nfg.nl

Reply to: