Sridhar wrote:
How do you login to a remote system automatically using expect? i tried to read the mans but didn't help... Any example will be help ful
A very brief tutorial follows... Execute the login program (for example 'ssh') with the 'spawn <progname and args>' command. Tell the machine what to expect with the 'expect "<string to expect>"' command. Tell the machine what to send in responce with 'send "<stuff to send>"'. You can also send stuff to the user with 'send_user "<string>". For example, lets login to a computer named bute, with username "john" and password "johnspass": pawn ssh bute -l john expect "Enter password for john@bute:" send "johnspass" expect "john@bute:~ > " send "logout" wait # I put this in otherwise it'll kill the ssh process when # the script finishes, possibly before you're logged out Hope that helps, Chris -- Unfortunately I'm back on V90 (yeah, right) dialup for the rest of my life, so I apologise in advance for any time delay in replies. Thanks. __ _ -o)/ / (_)__ __ ____ __ Chris Reeves /\\ /__/ / _ \/ // /\ \/ / ICQ# 22219005 _\_v __/_/_//_/\_,_/ /_/\_\ -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/