From: Austin S. <te...@of...> - 2003-09-16 19:29:16
|
On Sun, Sep 14, 2003 at 04:27:52PM -0500, Chris Muth wrote: > Does anyone have any ideas? The following code snippet works fine for me when called from cron. I recall having problems using expect with early versions of ssh. Perhaps you could tell us your OS, ssh, Expect, and IO::Tty versions? Btw, in reponse to a couple other postings, Expect uses IO::Tty to create a tty to run the command in and sets its controlling terminal to the tty it creates. Reads and writes to /dev/tty should work just fine. That's the idea anyway, and it works here just fine. I'm using: Expect v. 1.15, IO::Tty v. 1.00, perl 5.6.1, ssh OpenSSH_3.5p1, Linux, kernel ver. 2.4.20 Austin #!/usr/bin/perl -w use Expect; $ssh = new Expect; $ssh->spawn("/usr/local/bin/ssh", "localhost"); $ssh->expect(10, "password: "); print $ssh "$ARGV[0]\n"; $ssh->expect(10, '$' ); |