#!/usr/bin/expect
set host [lindex $argv 0]
set user [lindex $argv 1]
set passwd [lindex $argv 2]
set cmd [lindex $argv 3] # say, "ls -lrt"
spawn ftp $host
expect "login:"
send $user\n
expect "password:"
send $passwd\n
send $cmd\n
send "exit\n"
interact
set host [lindex $argv 0]
set user [lindex $argv 1]
set passwd [lindex $argv 2]
set cmd [lindex $argv 3] # say, "ls -lrt"
spawn ftp $host
expect "login:"
send $user\n
expect "password:"
send $passwd\n
send $cmd\n
send "exit\n"
interact
No comments :
Post a Comment