One major thing is wrong: no error checking anywhere. Take a look at the Synopsis again, all those "or die" statements are there for a purpose (change them to "or warn" if you want a softer fail).
Also, you're mixing calls to $ssh->exec() with $ssh->waitfor, which is wrong. exec reads out the data sent by the server, so by the time waitfor is called it has nothing to ... err... wait for. You should use "send" in conjunction with "waitfor". Again, RTFM
In reply to Re^3: ssh using expect
by tirwhan
in thread ssh using expect
by bala_999
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |